Case Sensitivity of Action Names in Struts 2

Posted by IK on Stack Overflow See other posts from Stack Overflow or by IK
Published on 2010-05-26T14:28:34Z Indexed on 2010/05/26 14:31 UTC
Read the original article Hit count: 148

Filed under:

Is there an easy way to make Struts 2 action names case insensitive? Currently I have the following action defined:

<action name="printTest" class="MyClass" >
  <result name="error">/WEB-INF/jsp/error.jsp</result>
  <result name="input">/WEB-INF/jsp/test.jsp</result>
  <result name="success">/WEB-INF/jsp/test.jsp</result>
</action>

If the user types URL "/app/printtest.do" instead of "/app/printtest.do" this action is not executed.

Other then mod_rewrite on the httpd level or something like that, the only option that I know about right now is simply adding the same exact action and changing the name to "printtest". Ideally it would be a simple config change to struts.xml

© Stack Overflow or respective owner

Related posts about struts2