Piece of cake. You can define forwards that point to actions. The syntax
below defines a forward to an action named 'myaction' defined in your
struts-config.xml file.
<forward name="someforward" path="/myaction.do"/>
I haven't done it, but I think you can do the same thing by creating an
ActionForward with "/myaction.do" and returning that from your Action class.
I've been using the first approach for a while and it works fine.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 12:37 PM
To: [EMAIL PROTECTED]
Subject: Defining a forward path- not to a JSP, but to another Action
Hi
In the examples I've seen - any forwards that are defined (whether
global-forwards or action-specific) seem to point to JSP pages, i.e.
<global-forwards>
<forward name="login" path="/login.jsp"/>
<forward name="success" path="/home.jsp"/>
</global-forwards>
However I'd like for my user to login (handled by LoginAction) and then not
just be sent straight to home.jsp. Instead, I'd like to forward to
HomeAction which will prepare the necessary beans for use by home.jsp.
How do I go about defining this in structs-config.xml? I'm a bit lost
because I keep seeing elements called "path" but some look like "/login.jsp"
and some look like "/login". Why is this? Can you put "/home.do" as a
forward path and it will forward to HomeAction? Or is this done simply by
putting "/home" as the forward path.
I'm sure this is very simple, but I really need to figure it out before my
boss realises how little progress I've made this week! =o(
Thanks.
Lindsay
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>