Title: RE: Actions with parameters

> -----Original Message-----
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 14 December 2000 19:57
> To: [EMAIL PROTECTED]
> Subject: Re: Actions with parameters
>
> Till Nagel wrote:
>
> > Is there any possibility to map actions with different parameters?
> >
> > Something like:
> >
> > <action path="/newsList" type="actions.NewsListAction" >
> >   <forward name="success" path="/newsList.jsp" />
> > </action>
> >
> > <action path="/newsListAFew" type="actions.NewsListAction" >
> >   <forward name="success" path="/newsList.jsp" />
> >   <parameter key="number" value="10" />
> > </action>
> >
> > There would be two advantages:
> > The designers do not have to be aware of parameters. They
> just call some
> > action.do's.
> > If we want to change the logic (i.e. the parameters) we
> must only change it
> > at struts-config.xml instead of everywhere referring to this action.
> >
>
> How about:
>
>     <action path="/newsListAFew?number=10"
>      type="actions.NewsListAction">
>         <forward name="success" path="/newsList.jsp"/>
>     </action>
>
> The Struts example application uses this technique quite a
> bit.  At runtime, the
> servlet container merges any request parameters on the path
> listed here with
> those from the original request when it does the forward.

I suspect this would not work for POST requests!?

Using the <set-property/> tag with seems to be clearer and
safer (read work with more Servlet Engines).

>
> >
> > Regards,
> > Till
>
> Craig McClanahan
>

Oliver Burn

Reply via email to