The key its stored under is simply the name you define it as in the
form-bean section in your struts config. IE:
<form-bean name="myBean" type="com.something.Form"/>

and then an action using this

<action .... name="myBean" scope="session">

Would put an instance of com.something.Form into the session scoped
attribute named myBean.
If you want to remove that bean from session at the end of your action you
could do something like:

if ("session".equalsIgnoreCase(mapping.getScope())) {
    request.getSession().removeAttribute(mapping.getName());
}

HTH,
David

----- Original Message ----- 
From: "Tim Penhey" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 01, 2004 10:03 AM
Subject: Removing form bean from where ever it is saved


> Hi All,
>
> I am trying to test some validation that I have set up for one of my
actions.
> I am using the org.apache.struts.validator.DynaValidatorForm with a couple
of Strings and
> an Integer.  However in my test to check the required validation, it
appears to be
> grabbing an existing form from some scope (almost certainly session) and
only updating the
> parameters that I have passed in.
>
> How can I remove the form from scope after the action has finished with
it?  I don't know
> that key that it is being stored against, is this defined somewhere?
>
> Thanks,
> Tim
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to