The framework uses a number of properties that can be changed to fityour needs. To change any of these properties, specify the property keyand value in an
struts.properties file. The properties file can be locate anywhere on the classpath, but it is typically found under
/WEB-INF/class
Constant ConfigurationConstants provide a simple way to customize a Struts application bydefining key settings that modify framework and plugin behavior. Thereare two key roles for constants. First, they are used to overridesettings like the maximum file upload size or whether the Strutsframework should be in "devMode" or not. Second, they specify which Bean, among multiple implementations of a given type, should be chosen.
Constants can be declared in multiple files. By default, constantsare searched for in the following order, allowing for subsequent filesto override previous ones:
- struts-default.xml
- struts-plugin.xml
- struts.xml
- struts.properties
- web.xml
The
struts.properties file is provided for backward-compatiblity with WebWork.
Interceptor
- The LoggingInterceptor simply logs before and after executing the rest of the ActionInvocation.
- The TimerInterceptor times the execution of the remainder of the ActionInvocation.
The StaticParametersInterceptor and Parameters Interceptor populate your Action fields during the ActionInvocation execution.
- The StaticParametersInterceptor applies the parameters defined in the Action configuration with the <param> elements.
- The ParametersInterceptor populates the Action with the parameters passed in as part of the request.
The StaticParametersInterceptor should be applied before theParametersInterceptor so that the static parameters may be set as thedefaults and overridden by the request parameters.
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點擊舉報。