Monday, November 3, 2008

what is a JSP

JSP stands for Java Server Pages. The need of this type of a thing came to the java world because it was a burdent of writing html in side java classes which are servlets. There we had to do our html part inside javas out.println(""); methods. But in jsp we have a dynamic behaviour with java and we use java inside html pages which have an extension of .jsp. This supports a lot to web designers who design the UI part which must be interactive rather than the functionalities of a developers parts.
In the life cycle of a jsp it becomes a servlet and ends with a .class file. First the jsp translates and then it compiles. Then as same as a servlet its jspInit() method (in servlets it is init()) runs and it is instantiated. Then all the requests for this are handled by the _jspService() method. and when this is going to end(life cycle) the jspDestroy() method runs. we can override the jspInit() and the jspDestroy() methods for our purposes which we will discuss later. but we cant override the _jspService() method.
As we are familliar with html we have to know how we can write java inside these html pages. We will discuss that in the next section.

****
for servlets visit http://myservlet.blogspot.com
****

No comments: