Hi Brian,

Why not use different named forwards for the action and access each one from
the action with a:

{
...
return (mapping.findForward("page1/page2/page3"));
}

In s-c:

<action path="/myAction"
  type="<FQ Class>"
  name="<bean>"
  ...
>
<forward name="page1" path="/page1.jsp"/>
<forward name="page2" path="/page2.jsp"/>
<forward name="page3" path="/page3.jsp"/>
</action>

Hue.

> -----Original Message-----
> From: Brian McSweeney [mailto:[EMAIL PROTECTED]
> Sent: 28 July 2003 10:39
> To: [EMAIL PROTECTED]
> Subject: Design Question - same action, many jsps/views
>
>
> Hi all,
>
> I've come across a situation which I'm not sure how to handle with
> struts.
> I have an action which, depending on from which page it's called,
> should forward to different jsps pages.
>
> Currently, for each resultant jsp, I create a new action with the exact
> same
> logic code inside which forwards to the right jsp.
>
> I'm just not sure if this is the right way to do it, because it's
> replication of code.
> An alternative might be to switch on the input path of the request and
> forward to
> The right jsp, but I'm not sure if this is right either. This has to
> have come up
> before, so I'm looking for a best practice solution.
>
> What do you guys reckon?
>
> Thanks,
> Brian
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/2003
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/2003


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to