• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

session data mixed up problem

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working on a web application in JSP model 1, which includes another jsp file as html form with values from bean defined in the parent JSP file, and posts request back to parent JSP to process the request. This JSP page has session data mixed up problem and I could not find what's wrong in the code. (In fact, we couldn't reproduce this problem in our QA. The problem only occured when there are a lot of concurrent users.) The JSP does not have instance variables, and the majority code were got compiled in the service() method. It looks like this:
-------------

<%@ page session="true" />
<jsp:useBean id="data" scope="page" class="com.company.package..." />

<% .... JAVA code process the html form .... %>

<%@ include file="htmlForm.jsp" />

And in htmlForm.jsp:

<% some JAVA code that uses variables and beans defined in parent JSP %>
<!-- html form -->
<input type="text" name="field" value="<%= data.getName() %>" />

--------------
Can anyone help me to figure what's wrong on this code? We were using inclue tag to embed the html form in the parent JSP, is this the cause of the session data error? Should we use jsp:include instead? Or is there any other possible reason that the JSP is not thread safe? (Again, the JSP doesn't have any instance variables)!

Thanks very much for any help! I've run out of ideas on how to debug this problem!

[ October 19, 2004: Message edited by: JW Li ]

[ October 19, 2004: Message edited by: JW Li ]
[ October 20, 2004: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're going to have to give more information here if you want some help.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm going to have to agree. At the moment the only thing we know for sure is that you have a problem. I still tend to think it's a thread safety problem, but there have been times when HTTP proxies have swapped user's session IDs, but this was a pretty extreme case.
 
JW Li
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your input! It's very hard to get the related part of code posted, partly because the long trivial processing code, and partly because I don't know what's wrong. Anyway, here's the code, and thanks very much for your patience to help me debug... I am thinking maybe we should use jsp:include instead of include to embed the html form jsp since it contains dynamic data in it, which may cause thread safety problem...

The problem is that customer A gets customer B's notes:

-----------------------
customer.jsp:



-----------------------
Thanks again! Any input is highly appreciated!
[ October 20, 2004: Message edited by: JW Li ]

[ October 20, 2004: Message edited by: JW Li ]
[ October 20, 2004: Message edited by: JW Li ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic