Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getParameter, setAttribute and session values

843841Oct 25 2004 — edited Oct 26 2004
I am having a problem forwarding values to a jsp from my servlet.

This problem only occurs when multiple users are accessing the same pages to make a payment.

The value is passed from the page to the servlet.
The servlet gets the value using a getParameter.

//Get the value from the previous page
String DocTotal = request.getParameter("DocTotal");
logger.debug("DocTotal: " + DocTotal);
//set the value to pass to next page
request.setAttribute("payAmount", DocTotal);

displayTemplate(CREDITCARDPAYMENT);

displayTemplate code follows.
RequestDispatcher rd = getServletContext().getRequestDispatcher(template);
rd.forward(req, res);

I then set the value in the request object to pass to the next page.
This all seems to work fine for a single user but when I I have more than one user, one user will get a null for value being passed on the next page and the other user will not get the page displayed.

It is like my session values are getting stomped on by the other user.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2004
Added on Oct 25 2004
12 comments
707 views