If you want to access parameters, the params
interceptor should go first
<action name="validatorAction" class="com.keyur.struts2.ActionClasses.validatorClass" method="execute">
<interceptor-ref name="params"></interceptor-ref>
<interceptor-ref name="encrypt"></interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
<result name="success">/success.jsp</result>
<result name="input">/index.jsp</result>
</action>
Your problem is that those parameters don't go to the valueStack
, and you should probably get them from the action context.
Map params = ActionContext.getContext().getParameters();
But after params
interceptor they should be there.