File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session scope mixed up

 
Sekhar Chand
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
I was searching whole day but i didnt get the correct solution.
If two users submitting values at the same time, session is mixing up and first userid getting second userid values
Please try to solve this as soon as possible

Thanks and regards
sekhar
[ May 26, 2008: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sekhar Chand:
Please try to solve this as soon as possible

Firstly, please read this. Questions on the Ranch are answered by volunteers, and being pushy is a good way to drive them away rather than get them to help you.

Secondly, the types of problems you are describing are usually caused by threading issues in Java classes or the JSPs. Since you are using the really old-fashioned Model 1 structure, the problem is likely:

1) Instance variables in class instances that are shared across threads

2) The use of the declaration syntax in a JSP, e.g. <%! ... %>

At this point, I'd guess the problem is (2) since you haven't given any substantive data to go on. Do you use the declaration syntax in your JSPs?
[ May 26, 2008: Message edited by: Bear Bibeault ]
 
Sekhar Chand
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

First of all sorry for my mistake.
I am using just JSP Model 1 framework and so session is a implicit variable.
So i am using session to get session.Code is like this

session = request.getSession(true);
session.setAttribute("userId",request.getParameter("userId"));

this one is executing only once when ever user login successfully.
I am not creating any variables.
Just using implicit objects.
Is it a problem.

Thanks and Regards
sekhar
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sekhar Chand:
I am using just JSP Model 1 framework and so session is a implicit variable.
The session implicit variable is available no matter what model you employ.

I am not creating any variables.
Just using implicit objects.
Perhaps it is time to show us the JSP code. Please be sure to use UBB code tags to preserve the formatting.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic