struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <andrew.david.h...@gridnode.com>
Subject RE: Parameters to an Action in struts-config.xml
Date Mon, 01 Mar 2004 10:15:47 GMT
Yes. Here is an example:

<action path="/blah"
            type="com.example.MyAction"
            className="com.example.MyActionMapping"
            name="blah"
            scope="request">
      <set-property property="foo" value="hamlet"/>
      <set-property property="bar" value="othello"/>
      <set-property property="baz" value="romeo" />
</action>

You set the className attribute of the actionmapping to your ActionMapping
subclass that has setters (and usually getters) for the properties you want.

You have to set those properties using the <set-property> element (darn
nuisance) to get around the dtd.

And remember that the properties belong not to the action instance but to
the mapping so in your action you could use mapping.getFoo() to get the
value...

hth
Andrew

-----Original Message-----
From: Boaz Barkai [mailto:boaz@2train4.com]
Sent: Monday, 1 March 2004 18:05
To: 'Struts Users Mailing List'
Subject: Parameters to an Action in struts-config.xml


Hi

Is there a why to give config parameters to an Action entry in the
struts-config.xml
(I mean several parameters - the parameter attribute isn't enuff)

Thanks

Boaz



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message