tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramesh Kumar.T" <rameshku...@india.adventnet.com>
Subject Re: JSP Race Condition
Date Fri, 21 Jul 2000 14:42:24 GMT
Hi,
this not b'cos of the race condition
it must be due to the declaration of the variables  in this format

<%! int i=0 ; %>
if u declare some variables like this then
only one instance of this variable will be made if you have session scope for
your page ( i suppose the default)
├żerefore declare the variables within scriptlets
like this
<%
int i=0;
%>
and this will work
hope this helps

bye
Ramesh

"Kane, David" wrote:

> Folks,
>
> We have an apparent race condition in a JSP that have written.  We are able
> to create the error when we have two different users, A and B hit the same
> JSP by way of a get request.  The request URL has a single parameter
> embedded in it, and the two users have a different values for that
> parameter.  When both users hit the site at the the same time, user A
> appears to work correctly, but user B appear to get user A's parameter
> value.  (i.e. the request.getParameter() method appears to be returning the
> incorrect value)  We've trimmed out much if the interesting pieces of our
> JSP, and we are still able to recreate the problem.  We found a snippet of
> the jasper.log file which we believe corresponds the occurance of the error,
> and it looks like the information for the two requests are getting
> intermingled in the log file (see below).  We are running Tomcat 3.1, Apache
> 1.3.12 on RedHat release 6.2.  Has anyone seen this behavior before?  Any
> suggested workarounds?  Thanks!
>
> Sincerely,
> David Kane
>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000 JspEngine -->
> /html/manager/EmpSkillsRpt.jsp</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000            ServletPath:
> /html/manager/EmpSkillsRpt.jsp</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000               PathInfo:
> </JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000               RealPath:
> /www/ksis/html/manager/EmpSkillsRpt.jsp</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000 JspEngine -->
> /html/manager/EmpSkillsRpt.jsp</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000             RequestURI:
> /ksis/html/manager/EmpSkillsRpt.jsp</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000            ServletPath:
> /html/manager/EmpSkillsRpt.jsp</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000            QueryString:
> userID=16745</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000               PathInfo:
> </JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000         Request Params:
> </JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000               RealPath:
> /www/ksis/html/manager/EmpSkillsRpt.jsp</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000                userID =
> 16745</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000             RequestURI:
> /ksis/html/manager/EmpSkillsRpt.jsp</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000 Classpath according to the Servlet
> Engine is:
> /www/ksis/WEB-INF/classes:/www/ksis/WEB-INF/lib/KSIS.jar</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000            QueryString:
> userID=18124</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000         Request Params:
> </JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000                userID =
> 18124</JASPER_LOG>
> <JASPER_LOG> Wed Jul 19 19:09:36 EDT 2000 Classpath according to the Servlet
> Engine is:
> /www/ksis/WEB-INF/classes:/www/ksis/WEB-INF/lib/KSIS.jar</JASPER_LOG>


Mime
View raw message