Tuesday, 12 April 2016

How we can configure constants in Struts 2 ?


Constants provide a simple way to customize a Struts application by defining key settings that modify framework and plugin behavior.


Constant in struts.xml

<struts>
  <constant name="struts.devMode" value="true" />
  ...
</struts>


Constant in struts.properties

struts.devMode = true


Constant in web.xml

<filter>
    <filter-name>struts</filter-name>
    <filter-class>
       org.apache.struts2.dispatcher.FilterDispatcher
    </filter-class>
    <init-param>
        <param-name>struts.devMode</param-name>
        <param-value>true</param-value>
    </init-param>
</filter>

No comments:

Post a Comment

Note: only a member of this blog may post a comment.