You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by MARK NICHOLS <DH...@dhs.state.il.us> on 2002/03/13 19:44:44 UTC

Re: Defining a forward path- not to a JSP, but to another Action

I have done what you want. Here is a piece of my struts-config.xml:

	<!-- Finish Reason Insert action -->
	<action		path="/finishReasonInsert"
				type="vcm.vis.action.FinishReasonInsertAction"
				name="finishReasonForm"
			   scope="session"
			   input="finishReasonInsert.jsp"
		   parameter="method">
			<forward	name="success"	path="/loadFinishReason.do"/>
			<forward	name="failure"	path="/finishReasonInsert.jsp"/>
	</action>

The "success" path from finishReasonInsert (action) is the loadFinishReason (action). 

HTH,

/\/\ark


___________________________________
- mark h. nichols
- dhsv022 at dhs dot state dot il dot us 

The best laid plans o'mice and men gang aft aglay...
-Robert Burns

>>> lindsay.hamoudi@bt.com 03/13/02 11:37AM >>>
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:   <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>


Re: Defining a forward path- not to a JSP, but to another Action

Posted by keithBacon <ke...@yahoo.com>.
>> Can you put "/home.do" as a
>> forward path and it will forward to HomeAction?
yes & that's the recommended way - if you search the archive (I know it will
take ages) there's some good discussion on this.

I always use path="/home.do" I think leaving the .do off means the same thing.

--- MARK NICHOLS <DH...@dhs.state.il.us> wrote:
> I have done what you want. Here is a piece of my struts-config.xml:
> 
> 	<!-- Finish Reason Insert action -->
> 	<action		path="/finishReasonInsert"
> 				type="vcm.vis.action.FinishReasonInsertAction"
> 				name="finishReasonForm"
> 			   scope="session"
> 			   input="finishReasonInsert.jsp"
> 		   parameter="method">
> 			<forward	name="success"	path="/loadFinishReason.do"/>
> 			<forward	name="failure"	path="/finishReasonInsert.jsp"/>
> 	</action>
> 
> The "success" path from finishReasonInsert (action) is the loadFinishReason
> (action). 
> 
> HTH,
> 
> /\/\ark
> 
> 
> ___________________________________
> - mark h. nichols
> - dhsv022 at dhs dot state dot il dot us 
> 
> The best laid plans o'mice and men gang aft aglay...
> -Robert Burns
> 
> >>> lindsay.hamoudi@bt.com 03/13/02 11:37AM >>>
> 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:   <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>
> 


=====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>