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.
struts.xml
.staticParams
Interceptor is included in the Action's stack.
staticParams
.setParams(Map)
method.staticParams
Interceptor will set the defined values to the Map, using the name as the entry key.key | value |
---|---|
myStaticParam1 | myStaticValue1 |
myStaticParam2 | myStaticValue2 |
myStaticParam3 | myStaticValue3 |
param
elements in the action mapping.staticParams
Interceptor will set the defined values to each JavaBean property that corresponds to a param
element.@see com.opensymphony.xwork.interceptor.StaticParametersInterceptor
@see com.opensymphony.xwork.config.entities.Parameterizable