1.

Provide Some Important Struts2 Constants That You Have Used?

Answer»

Some of the Struts2 constants that I have used are: 

  • struts.devMode to run our APPLICATION in DEVELOPMENT mode. This mode does reload properties files and provides extra LOGGING and debugging feature. It’s very useful while developing our application but we should turn it off while MOVING our code to production. 
  • struts.convention.result.path to configure the location of result PAGES. By default Struts2 look for result pages at {WEBAPP-ROOT}/{Namespace}/ and we can change the location with this constant. 
  • struts.custom.i18n.resources to define global resource bundle for i18n support. 
  • struts.action.extension to configure the URL suffix to for Struts2 application. Default suffix is .action but sometimes we might want to change it to . do or something else. 

We can configure above constants in struts.xml file like below. 

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

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

< constant name="struts.custom.i18n.resources" value="global" > < /constant >

< constant name="struts.convention.result.path" value="/" > < /constant >

Some of the Struts2 constants that I have used are: 

We can configure above constants in struts.xml file like below. 

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

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

< constant name="struts.custom.i18n.resources" value="global" > < /constant >

< constant name="struts.convention.result.path" value="/" > < /constant >



Discussion

No Comment Found