You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Scott Carlson <Sc...@yahoo.com> on 2002/07/04 05:20:03 UTC
Re: how to remove ActionForm from session
If you are in an Action that specified that form with the "name"
attribute in the Struts-config.xml, you can use this sample:
request.getSession().removeAttribute(mapping.getName());
If you have a BaseAction class (always a good idea), you could have a
method like below, and just call that. Encapsulation goooood...
protected void clearFormBean(HttpRequest request, ActionMapping mapping)
{
request.getSession().removeAttribute(mapping.getName());
}
Does this help/work for you?
Hoang, Hai wrote:
> Most of my forms are in the session scope. I want to remove it from the
> session object when I am done using it. My question is, is there a way for
> me remove those forms? Remove an object from the session is easy but how do
> I know which one to remove?
>
> --
> 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>