You have to use a custom Mapping class. Depending on whether you use Struts
1.0 or the 1.1-dev prerelease you either specify the mapping class globally
or for each action mapping. In case of the former - 1.0.x - you use an init
parameter called "mapping" when configuring the Action servlet in the
web.xml descriptor. In case of the latter - 1.1-dev - you would use the
"className" attribute in the action element of the struts-config. (BTW, is
there any "elegant" way to globally set the mapping class to be used? I
could not find one).

This mapping class should provide the properties in question and appropriate
getter and setter methods (in your case "needsLogin"). In the perform()
method of your Action class you can then cast the mapping parameter to your
custom mapping class and retreive the value for the property.

Regards,

Jürgen

> -----Ursprüngliche Nachricht-----
> Von: Edward Q. Bridges [mailto:[EMAIL PROTECTED]]
> Gesendet: Donnerstag, 28. Februar 2002 15:25
> An: Struts Users Mailing List
> Betreff: passing parameters
> 
> 
> simple question, (i hope!)
> 
> if i set a property for an action in struts-config.xml like this:
> 
>               <action path="/view-channels"
>         type="contentdb.view.channels.ViewChannelsAction" 
>         name="viewChannelsForm" 
>         scope="request" 
>         validate="true" 
>         input="/WEB-INF/jsp/ViewChannelItems.jsp">
>             <set-property property="needsLogin" value="true"/>
>               </action>
> 
> 
> how could i then retrieve the value of "needsLogin" from an 
> Action class?
> 
> thanks!
> --e--
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

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

Reply via email to