Alexander is right you can forward to another action in this way. It may start to get a bit complicated when you need to introduce request parameters for the action you are forwarding to and you may find yourself creating query strings inside the action class which I believe someone (either Ted H or Craig M) described as a regression into Model 1.
But hey if it works for you go for it! ----- Original Message ----- From: "Alexander Jesse" <[EMAIL PROTECTED]> To: "struts-user" <[EMAIL PROTECTED]> Sent: Wednesday, November 21, 2001 10:54 AM Subject: RE: Forward from one Action-instance to another > Hi, > > add a mappring like this: > <action path="/foo" type="FooAction"> > <forward name="success" path="/index"/> (or /index.do) > </action> > > I am working off-memory... but I did it once and it worked... > > good luck > Alexander > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, November 21, 2001 11:37 AM > To: [EMAIL PROTECTED] > Subject: Forward from one Action-instance to another > > > My case (simplified): > > Given an application with these two action-mappings: > > <action path="/index" type="IndexAction"> > <forward name="success" path="/index.jsp"/> > </action> > <action path="/foo" type="FooAction"> > <forward name="success" path="/index.jsp"/> > </action> > > My IndexAction's perform-method adds some stuff on the HttpServletRequest > that is used by the index.jsp page. Let's say fetch a Collection of objets > from persistent storage. The index.jsp might then iterate through the > Collection and display its objects in some way. > > The FooAction's perform-method does something else to respond to a request > for the /foo.do URL. When the FooAction.perform() has done its job, I want > to do whatever is necessary to display index.jsp properly. Now, I don't like > the idea of duplicating the functionality of IndexAction.perform() in > FooAction.perform(). So, I thought a forward to IndexAction would be nice, > just to make sure the necessary data are available to the index.jsp page. > > My questions: > > Can anyone recommend a way to do this? > And can it be done without hard-coding the IndexAction name in my Java-code > in any way? (To make it flexible and reconfigurable) > > Any answer appreciated, > > Rune Salthaug > Ementor Sweden AB > > > -- > 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]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

