September 28, 2011

Changing the Struts2 default .action extension

In order to change the default extension, which is .action, in Struts 2 to something else, configure the <constant> element in the struts.xml configuration file as follows,

<struts>
   
   <constant name="struts.action.extension" value="dud"/>

   <package name="myPackage" extends="struts-default">
   
   ...

   </package>
</struts>

Test the Hello World - Struts 2 example with the following URL in the browser,

http://localhost:8080/WebAppName/Name.dud

No comments:

Post a Comment