Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP lifecycle

 
natarajan gopi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,all
In Genral, JSP are converted into Servlets.
I want to know whether
those servlets are HttpSerlvet or GenericServlet.. ?


Please clarify my doubt..

Thanks in advance,
Gopi.N.
[ July 03, 2006: Message edited by: Bear Bibeault ]
 
Travis Hein
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This by default will be javax.servlet.http.HttpServlet, though I guess it is possible for different servlet containers to extend something else by default like their own custom extension to the HttpServlet.

Tomcat 5.x uses jasper2, and looking in the org.apache.jasper.compiler.Generator class in the tomcat sources, jasper builds JSP pages into servlets that extend the HttpServlet by default.

Though there is the JSP page directive

that can be used to tell the JSP compiler to build Servlets using the base class that you specify. This is handy if you have some framework or custom stuff you want to be available for all jsp pages.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Travis Hein:
This is handy if you have some framework or custom stuff you want to be available for all jsp pages.


Although these days, servlet filters or preludes are considered a better means of doing so.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!