getParameter, setAttribute and session values
843841Oct 25 2004 — edited Oct 26 2004I 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.