I'm trying to set an Enum value to the Following action
<action name="actionOne" class="SomeClass">
<param name="myValue">@some.package.Enum@VALUE</param>
<result name="success">result.jsp</result>
</action>
but when debugging it, it shows myValue:
null.
myValue corresponds to a private object with its public getter and setter. Is it possible to do this? what am i doing wrong?
For that you need to configure Static Parameters Interceptor. You need to enable parsing of static parameters and exclude them from the request parameters map. Also wrap your parameter value in ${...} in order to evaluate it.
<action name="actionOne" class="SomeClass">
<interceptor-ref name="defaultStack">
<param name="staticParams.parse">true</param>
<param name="staticParams.merge">false</param>
</interceptor-ref>
<param name="myValue">${@some.package.Enum@VALUE}</param>
<result name="success">result.jsp</result>
</action>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With