• 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 scope mixed up

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic