Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

insert Enum value in param action

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?

like image 440
Anyul Rivas Avatar asked Dec 04 '25 13:12

Anyul Rivas


1 Answers

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>
like image 61
Aleksandr M Avatar answered Dec 11 '25 01:12

Aleksandr M



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!