Apache Struts 2 Documentation > Home > FAQs > How do we access static parameters from an Action |
Static (or pre-defined) parameters can be set to a Map property or to individual JavaBean properties.
<action name="myAction" class=" MyAction"> <param name="myStaticParam1">myStaticValue1</param> <param name="myStaticParam2">myStaticValue2</param> <param name="myStaticParam3">myStaticValue3</param> </action>
key | value |
---|---|
myStaticParam1 | myStaticValue1 |
myStaticParam2 | myStaticValue2 |
myStaticParam3 | myStaticValue3 |
public String getMyStaticParam1() public void setMyStaticParam1(String myStaticParam1) public String getMyStaticParam2() public void setMyStaticParam2(String myStaticParam2) public String getMyStaticParam3() public void setMyStaticParam3(String myStaticParam3)
@see com.opensymphony.xwork.interceptor.StaticParametersInterceptor
@see com.opensymphony.xwork.config.entities.Parameterizable