I'm using Struts 2.3.
I have an interceptor with a parameter (note: code slightly simplified to remove some casts):
private String parameterName = null;
private String parameterValueSuffixParameter = null;
// getter and setter.
// in my doIntercept(), get the view.suffix Integer parameter from the page;
parameterName.concat(context.getParameters().get(parameterValueSuffixParameter)[0]);
This parameter is defined on the struts.xml action definition:
<action name="actionName" method="methodName" class="com.example.myAction>
<interceptor-ref name="defaultStack">
<param name="interceptor.parameterName">parameterValue</param>
<param name="interceptor.parameterValueSuffixParameter">view.suffix</param>
</interceptor-ref>
<result name="success">/jsp/result.jsp</result>
</action>
and on the page:
<s:hidden name="view.suffix" value="%{view.suffx}" />
Now, what I want to do is get rid of the extra parameter in my struts.xml and the parameter.concat line by directly using the value of the suffix in my interceptor param. Is this possible?
I already tried parameterValue${view.suffix}
, but that didn't work, parameterName was literally set to that as a string.