parameter is also used for ForwardAction. Actually, any action can access its 
parameter using mapping.getParameter() and use it however it wants. We do this in 
several actions.

>From the ActionConfig javadoc:

parameter

protected java.lang.String parameter
General purpose configuration parameter that can be used to pass extra iunformation to 
the Action instance selected by this Action. Struts does not itself use this value in 
any way. 

However, Sloan, you ar right that it is limited to passing one parameter and that the 
parameter's intended use is unclear if it is simply called "parameter". Brandon's 
solution to subclass ActionMapping is probably the best (only reasonable?) alternative.

Derek Richardson

> -----Original Message-----
> From: Brandon Goodin [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 2:33 PM
> To: Struts Users Mailing List
> Subject: RE: Passing parameters to Actions
> 
> 
> parameter is only used for dispatch actions. If you want to 
> set properties
> for an action... you can extend the ActionMapping class and use the
> set-property in an action element while specifying the 
> className attribute
> of the action element.
> 
> Brandon Goodin
> Phase Web and Multimedia
> PO Box 85
> Whitefish MT 59937
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
> 
> 
> -----Original Message-----
> From: Sloan Seaman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 12:29 PM
> To: Struts Users Mailing List
> Subject: Passing parameters to Actions
> 
> 
> In the struts-config.xml file I want to pass a few parameters 
> to my actions
> but it looks like the DTD only supports one "parameter" tag.
> 
> I.E.:
> <action path="/app/main"
>    type="com.symbol.mobilecommerce.analysis.actions.app.Main"
>    name="app.main"
>    parameter="admin"
>    >
>    <forward name="PAGE_SRC" path="/app/main.jsp"/>
>    <forward name="PAGE_ACCESS_DENIED" path="/index.jsp"/>
> </action>
> 
> When I would rather do something like:
> <action path="/app/main"
>    type="com.symbol.mobilecommerce.analysis.actions.app.Main"
>    name="app.main"
>    >
>    <forward name="PAGE_SRC" path="/app/main.jsp"/>
>    <forward name="PAGE_ACCESS_DENIED" path="/index.jsp"/>
>    <parameter name="ROLES_ALLOWED" value="admin"/>
> </action>
> 
> Now,  I know there is a roles attribute but we are doing out 
> own security
> model and are not using request.isUserInRole().
> 
> (BTW: is there any way to write to whatever 
> request.isUserInRole() used to
> do its lookup so we can use it?)
> 
> Is there any way to have parameters passed like how I would like?
> 
> I could spoof <forward> to something like <forward 
> name="ROLES_ALLOWED"
> path="admin"/> but I would rather not.
> 
> Thanks!
> 
> --
> Sloan
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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

Reply via email to