You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/03/23 20:00:30 UTC
DO NOT REPLY [Bug 18258] New: -
preloaded jsp's have their init method called again on first hit
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: tomcat-dev@jakarta.apache.org
ReportedBy: steve5m@yahoo.com
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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org