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.

>
> Regards,
> Till

Craig McClanahan


Reply via email to