8:43 pm - Thursday April 27, 2017

Introduction to JSP

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

Introduction to JSP

Java Server pages (JSP) is a server side programming language helps to build dynamic web based applications.

HTML code that contains java and Servlet is known as servlet

 

Advantages of JSP

JSP uses simplified scripting language for embedding  java servlet into HTML

Disadvantages of JSP

JSP compiles on server It will be too slow while loading it for first time

Debugging is difficult when compared with java.

 

Difference between servlet and JSP               

Servlet Jsp
Servlet run faster than jsp Jsp run slower because of their compilation model
Servlet act as Controller in MVC pattern JSP act as a View in MVC pattern
It is preferable to write code to control view page and connects your logic JSP is preferable to build a design page that contains java objects
Custom tags cannot be build in servlet JSP supports custom tag
Precompiled html cannot be used Precompiled html can be used via taglib

 

Compilation model of JSP

 

All JSP files are compiled into servlet code(.java) file and javac complier will convert the .java file to .class file

Ex: index.jsp will convert into index.java and then to index.class finally the html output is generated from the class file.

 

JSP life cycle

jspInit()

_jspService()

jspDestroy()

jspInit()

Will initialize the jsp code

_jspService()

All your logic and request response are processed here.

jspDestroy()

Will used to clean up the objects used by the jsp

Filed in: Z-AJSP Codes

Comments are closed.