tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Yunusov <pyunu...@rogers.com>
Subject Re: Bezerk - tomcat calls JSP twice ?
Date Mon, 02 Dec 2002 03:40:09 GMT
On Sunday 01 December 2002 10:23 pm, Stephen Riek wrote:
> 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

Might be the hangover - I get correct output when I follow your steps and 
refresh with the parameter still in the URL and without too. I use Tomcat 
4.1.12.
My output with the parameter in the URL:

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

Paul

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message