You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by John C Alex <as...@hotmail.com> on 2007/11/16 22:20:26 UTC

Action Form with Session Scope

Hi All, I need some clarification ( rather suggestions ) on the below.

 <action-mappings >
    <action
      attribute="firstActionForm"
      input="first.jsp"
      name="firstActionForm"
      path="/firstAction"
      scope="request"
      type="com.deo.struts.action.FirstAction">
      <forward name="success" path="/second.jsp" />
    </action>
    <action
      attribute="secondActionForm"
      input="second.jsp"
      name="secondActionForm"
      path="/secondAction"
      scope="session"
      type="com.deo.struts.action.SecondAction">
      <forward name="success" path="/second.jsp" />
    </action>

Based on the mapping, from first jsp I can go to second jsp. Now in the
first Action class can I set some values in secondActionForm so that these
values can be available to second.jsp as the scope is set to session ?

Please let me know on the above.

Thanks
John
-- 
View this message in context: http://www.nabble.com/Action-Form-with-Session-Scope-tf4823931.html#a13801674
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action Form with Session Scope

Posted by Dave Newton <ne...@yahoo.com>.
If the forms were named the same thing then would the
same instance be retrieved in the second action?

I vaguely recall I trouble-shot an application
unknowingly had two actions with the same "name"
attribute, and since they were dynaforms there was no
class-cast exception to help clue them in.

That may not be relevant in this case, of course.

d.

--- Paul Benedict <pb...@apache.org> wrote:

> John,
> 
> You have two ways to do this:
> 
> 1) Use RequestUtils.createActionForm to create the
> 2nd form and stick
> it in session scope.
> 
> 2) Redirect to the second action, and include the
> properties you want
> to populate as request parameters.
> 
> Paul
> 
> On Nov 16, 2007 3:20 PM, John C Alex
> <as...@hotmail.com> wrote:
> >
> > Hi All, I need some clarification ( rather
> suggestions ) on the below.
> >
> >  <action-mappings >
> >     <action
> >       attribute="firstActionForm"
> >       input="first.jsp"
> >       name="firstActionForm"
> >       path="/firstAction"
> >       scope="request"
> >       type="com.deo.struts.action.FirstAction">
> >       <forward name="success" path="/second.jsp"
> />
> >     </action>
> >     <action
> >       attribute="secondActionForm"
> >       input="second.jsp"
> >       name="secondActionForm"
> >       path="/secondAction"
> >       scope="session"
> >       type="com.deo.struts.action.SecondAction">
> >       <forward name="success" path="/second.jsp"
> />
> >     </action>
> >
> > Based on the mapping, from first jsp I can go to
> second jsp. Now in the
> > first Action class can I set some values in
> secondActionForm so that these
> > values can be available to second.jsp as the scope
> is set to session ?
> >
> > Please let me know on the above.
> >
> > Thanks
> > John
> > --
> > View this message in context:
>
http://www.nabble.com/Action-Form-with-Session-Scope-tf4823931.html#a13801674
> > Sent from the Struts - User mailing list archive
> at Nabble.com.
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> >
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action Form with Session Scope

Posted by Paul Benedict <pb...@apache.org>.
John,

You have two ways to do this:

1) Use RequestUtils.createActionForm to create the 2nd form and stick
it in session scope.

2) Redirect to the second action, and include the properties you want
to populate as request parameters.

Paul

On Nov 16, 2007 3:20 PM, John C Alex <as...@hotmail.com> wrote:
>
> Hi All, I need some clarification ( rather suggestions ) on the below.
>
>  <action-mappings >
>     <action
>       attribute="firstActionForm"
>       input="first.jsp"
>       name="firstActionForm"
>       path="/firstAction"
>       scope="request"
>       type="com.deo.struts.action.FirstAction">
>       <forward name="success" path="/second.jsp" />
>     </action>
>     <action
>       attribute="secondActionForm"
>       input="second.jsp"
>       name="secondActionForm"
>       path="/secondAction"
>       scope="session"
>       type="com.deo.struts.action.SecondAction">
>       <forward name="success" path="/second.jsp" />
>     </action>
>
> Based on the mapping, from first jsp I can go to second jsp. Now in the
> first Action class can I set some values in secondActionForm so that these
> values can be available to second.jsp as the scope is set to session ?
>
> Please let me know on the above.
>
> Thanks
> John
> --
> View this message in context: http://www.nabble.com/Action-Form-with-Session-Scope-tf4823931.html#a13801674
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org