wood burning stoves 2.0*
The moose likes JSP and the fly likes session scope mixed up Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "session scope mixed up" Watch "session scope mixed up" New topic
Author

session scope mixed up

Sekhar Chand
Ranch Hand

Joined: Apr 05, 2006
Posts: 73
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

Joined: Jan 10, 2002
Posts: 60782
    
  65

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sekhar Chand
Ranch Hand

Joined: Apr 05, 2006
Posts: 73
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

Joined: Jan 10, 2002
Posts: 60782
    
  65

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
 
subject: session scope mixed up
 
Similar Threads
Help-populate object before form is loaded but before it's submitted
Passing JavaBean from jsp to servlet
session data mixed up problem
Retrieving data in session
How to implement Session Tracking