DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18258>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18258

preloaded jsp's have their init method called again on first hit

           Summary: preloaded jsp's have their init method called again on
                    first hit
           Product: Tomcat 4
           Version: 4.1.24
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


If you have a jsp with a jspInit method, and you preload this jsp, the jspInit 
method gets called, as it should, upon server startup. But now if you hit that 
jsp with your web browser, Tomcat calls the jspInit method again. (If you hit 
the jsp a second time, it's ok, doesn't call jspInit a third time.)
I will attach a war file that demonstrates this problem. Simply load this 
application (test_app.war) and two pages (preload1.jsp, preload2.jsp) each 
print out that their jspInit methods are called. Then hit the pages 
(http://host:port/test_app/preload1.jsp, etc.) and see that they print out (to 
System.out) that their jspInit methods are called once more.

Note I did previously file this same bug against Tomcat 4.1.16 (bug#15084) but 
I thought it was probably good to file again against the current release
so it is clear the problem still exists.

Why this is issue is important to me: I often do something fairly intenstive 
in my init methods, like load some data from a database (to cache it) - I don't
want this happening twice for no good reason.

Please note that other servlet containers, including Tomcat 3.x, Tomcat 4.0.6, 
Weblogic 7, and Resin, don't exhibit this "double-init" behavior.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to