https://issues.apache.org/bugzilla/show_bug.cgi?id=45774


Gerhard Kreutzer <[EMAIL PROTECTED]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[EMAIL PROTECTED]
                   |                            |t.de




--- Comment #4 from Gerhard Kreutzer <[EMAIL PROTECTED]>  2008-11-25 10:14:57 
PST ---
(In reply to comment #3)
> Thanks for the additional testing - it explains why I couldn't reproduce it.
> I'll take another look at what is going on.

I can confirm the behavior posted by Brian for Tomcat 5.5.20 and 5.5.27. After
changing a JSP, the generated Servlet will be instantiated twice, so the
described sequence init-destroy-init will appear.

I tested with the following JSP:
<%--
        Bug 45774 - jspDestroy called after deployment, the second jspInit
follows
        Bug 41606 - The jspInit method is called twice. 
--%>
<jsp:declaration>
        int counter = 0;
        private static long st = System.currentTimeMillis();
        private long it = System.currentTimeMillis();
        private long time = it - st;
        private static Object firstInstance;
        private Object secondInstance;

        public void init() throws ServletException {
                long ltime = System.currentTimeMillis() - st;
                System.out.println("init: " + this + ", time=" + time);
                if (time == 0) firstInstance = this;
                if (firstInstance != this) secondInstance = this;
        }
</jsp:declaration>

<html>
  <head>
    <title>InitTwice.jsp</title>
  </head>
  <body>
     <h1>InitTwice.jsp</h1>
    counter=<jsp:expression>++counter</jsp:expression>
    <br>
    current page=<jsp:expression>page</jsp:expression>
    <hr>
    first=<%= firstInstance %>
    <br>
    second=<%= secondInstance %>
    <br>
    time=<%= time %>
  </body>
</html>

Gerhard



-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to