tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Riek <stephenr...@yahoo.co.uk>
Subject Bezerk - tomcat calls JSP twice ?
Date Mon, 02 Dec 2002 03:23:13 GMT

I'm either still suffering from the effects of Saturday night or really didn't
understand something about Tomcat, because the following has me completely
surprised and unable to explain. 
I have a very very simple JSP "/Products/index.jsp" as follows - 
<%
int i = 1;
System.out.println("JSP PAGE DEBUGGING ************************************ " + i);
String pathSuffix = null;
if (request.getParameter("pathSuffix")!=null) {
 pathSuffix = request.getParameter("pathSuffix");
 System.out.println("JSP : request PARAMETER set in URL    : " + pathSuffix);
}
System.out.println("JSP : pathSuffix                      : " + pathSuffix);
%>

I open the page /Products/index.jsp?pathSuffix=helloworld in my browser
and the following appears at the Tomcat console - 

JSP PAGE DEBUGGING ************************************ 1
JSP : request PARAMETER set in URL    : helloworld  
JSP : pathSuffix                      : helloworld

No surprise so far.  

But then I change 'i' from 1 to 2 in the JSP and hit browser "refresh" 
and the following appears in the Tomcat  console -  

JSP PAGE DEBUGGING ************************************ 2
JSP : request PARAMETER set in URL    : helloworld
JSP : pathSuffix                      : helloworld

JSP PAGE DEBUGGING ************************************ 2
JSP : pathSuffix                      : null

What on earth is happening here in the last 2 lines ? Is the JSP being
called twice ? 

Further testing has shown that this occurs:

a. If I do not change the JSP and issue the same request to the JSP, 
    which makes me suspect it is related to caching somehow. 
b. Even if I change the JSP, but the request parameter is the same.

This is completely and utterly bizarre. Any output to the browser is 
NOT duplicated so it doesn't appear to have much effect but it's very
worrying for me, not being able to explain it. 

Could somebody please shed light on this ? Or am I still hungover ?

Stephen.




---------------------------------
With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs

Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message