Hello Matthias,

Great! Month ago I search all docs for it...

Wednesday, December 13, 2000, 6:54:18 PM, you wrote:

MK> Hi Till,

>> Is there any possibility to map actions with different parameters?

MK> Yes, see below.

>> 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>

MK> You have to add a (bean)property to your Action (in your example
MK> number). You can make the available to the action by (in 1.0) by

MK> <action path="/newsListAFew" type="actions.NewsListAction" >
MK>   <forward name="success" path="/newsList.jsp" />
MK>   <set-property property="number" value="10" />
MK> </action>

MK> The rest is left up to your action (ie, what you do with the property).

>> 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.

MK> I think, that's exactly the reason why <set-property> exists :) BTW, the
MK> property subelement is also valid for <forward>. See struts-config.dtd
MK> for more explanations.

MK> HTH.



-- 
Best regards,
 Oleg                            mailto:[EMAIL PROTECTED]


Reply via email to