You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Mann <rm...@latencyzero.com> on 2002/05/20 04:22:14 UTC

Good way to clear session state?

I've written a shopping cart/checkout app using Tomcat & Struts. The very
last action (the "place order" action), if successful, forwards to a JSP
showing an order confirmation and a thank you message.

After that page is returned to the client, I'd like to reset the user's
session state, so that if they proceed to add something new to their cart,
it will be an empty cart from which they start.

The problem is, I need that session state in order to display the
confirmation JSP. I suppose I could create a tag (or execute a scriptlet) in
the JSP, but I wondered if there were not a better way.

TIA,

-- 
Rick



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Good way to clear session state?

Posted by Michael Marrotte <ma...@nicusa.com>.
Rick;

Can't you just define a property in your Cart bean that holds the state?
Then when the user confirms payment do whatever processing necessary and set
the Cart state to say "confirmed".  Then you can allow users to only add
items to say an "empty" Cart.  So, maybe the Cart will be holding "old
items", that's OK?  Empty and reset the "state" before the user ever tries
to put in new "items".

--Michael Marrotte

-----Original Message-----
From: Rick Mann [mailto:rmann@latencyzero.com]
Sent: Sunday, May 19, 2002 7:22 PM
To: Struts Users Mailing List
Subject: Good way to clear session state?


I've written a shopping cart/checkout app using Tomcat & Struts. The very
last action (the "place order" action), if successful, forwards to a JSP
showing an order confirmation and a thank you message.

After that page is returned to the client, I'd like to reset the user's
session state, so that if they proceed to add something new to their cart,
it will be an empty cart from which they start.

The problem is, I need that session state in order to display the
confirmation JSP. I suppose I could create a tag (or execute a scriptlet) in
the JSP, but I wondered if there were not a better way.

TIA,

--
Rick



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>