Meaningless Drivel is fun!
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
JavaRanch » Java Forums » Java » JSP
Bookmark "jspInit() is Tomcat specific?" Watch "jspInit() is Tomcat specific?" New topic

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?

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

Joined: Jul 06, 2005
Posts: 1580
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?
I agree. Here's the link:
subject: jspInit() is Tomcat specific?
It's not a secret anymore!