You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Michael Remijan <re...@dchain.com> on 2000/08/19 22:48:57 UTC

object retieved from session via getAttribute loosing it's values

Hi,

When I'm getting an object out of the session with getAttribute, the values
that I se in that object are not being saved.  Here is what happens.

1) use a servlet to open page1.jsp using

request.getRequestDispatcher(response.encodeURL(pageName)).forward(request,r
esponse);

2) fill in form values String1 and String2.  page1.jsp has a hyperlink on it
that calls a javascript that submits the form to the servlet and goes to
page2.jsp.  The servlet stores the values of String1 and String2 in an
Object and puts that object in the session using
session.setAttribute(<..>,<..>);  The the servlet opens page2.jsp using
request.getRequestDispatcher(response.encodeURL(pageName)).forward(request,r
esponse);

3) page2.jsp gets the object from the session, typecasts it, and re-displays
the values entered for String1 and String2.  It also contains a form for
entering values for String3 and String4.  page2.jsp has a hyperlink on it
that calls a javascript that goes back to page1.jsp.  IN THE SERVLET WHEN
THE OBJECT IS RETIEVED FROM THE SESSION THE VALUES FOR STRING1 AND STRING2
ARE GONE DISPITE THE FACT THAT THEY WERE JUST DISPLAYED IN THE JSP PAGE.

Any thoughts on this would help

Michael J. Remijan
Software Engineer

dChain Commerce
2401 South Neil Street
Champaign, IL 61820
217.398.1860 x249