This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes jspInit() is Tomcat specific? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jspInit() is Tomcat specific?" Watch "jspInit() is Tomcat specific?" New topic
Author

jspInit() is Tomcat specific?

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
If suppose I write jspInit() method in declaration element of JSP:



If I use Tomcat then this method will be called from init() method of servlet that is going to be generate from this JSP. Something like this:



But If I deploy this on any other server (Web Logic or Web Sphere Application Server) then it's not necessary that this method will be called from init() method. Something like this:




Is everything is right?

Thanks.
[ December 07, 2005: Message edited by: Bear Bibeault ]
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
jspInit is not just a Tomcat thing. Its part of the JSP specification, and has been from the beginning.

Does the jspInit() method get called in WebSphere/WebLogic? Does it do the System.out.println()?
Maybe the jspInit() is being called from somewhere else in those appservers?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jspInit() is Tomcat specific?
 
Similar Threads
Servletcontext object to actionservlet in struts
JSP init parameters.
basic question
jspInit()
Initialization for a JSP