You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tim Sawyer <ts...@nildram.co.uk> on 2002/02/17 00:49:26 UTC
Action Forwards
Hi,
There's nothing to stop me forwarding to a do rather than a jsp in the
struts config is there? Like this:
<action path="/AddFindParty/FindPartyResults"
type="com.pancredit.tkbespoke.tjs.strutstest.action.FindPartyPostAction"
name="addFindPartyModuleForm"
scope="session"
input="index.jsp">
<forward name="success" path="/AddFindParty/FindPartyResults.do"/>
</action>
Cheers,
Tim.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Action Forwards
Posted by James Mitchell <jm...@yahoo.com>.
No problem at all.
Here is an example of what I am using.
In my IndexAction, I get a property from the ApplicationResources that
determines whether the index page should be a login or the main menu. This
lets me decide at deployment time whether the user sees a login or the main
menu.
my index.jsp has a request.
--------------------------------- index.jsp
<%
pageContext.forward( "/index.do");
%>
--------------------------------- struts-config.xml
<action-mappings>
<action path="/index" type="com.xyz.IndexAction">
<forward name="login" path="/index.do?action=login"/>
<forward name="main" path="/main.do"/>
</action>
<action path="/login" type="com.xyz.LoginAction"
scope="request"
name="userView"
validate="true"
input="/index.jsp">
<forward name="login" path="/login.jsp" />
<forward name="success" path="/mainmenu.jsp" />
<forward name="failure" path="/index.jsp"/>
</action>
<action path="/main" type="com.xyz.MainAction"
input="/index.jsp">
<forward name="success" path="/mainmenu.jsp" />
</action>
James Mitchell
Software Engineer
Open-Tools.org
Home Phone (770) 822-3359
Cell Phone: (678) 910-8017
-----Original Message-----
From: Tim Sawyer [mailto:tsawyer@nildram.co.uk]
Sent: Saturday, February 16, 2002 6:49 PM
To: Struts List
Subject: Action Forwards
Hi,
There's nothing to stop me forwarding to a do rather than a jsp in the
struts config is there? Like this:
<action path="/AddFindParty/FindPartyResults"
type="com.pancredit.tkbespoke.tjs.strutstest.action.FindPartyPostAction"
name="addFindPartyModuleForm"
scope="session"
input="index.jsp">
<forward name="success" path="/AddFindParty/FindPartyResults.do"/>
</action>
Cheers,
Tim.
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>