分享

struts2资料

 cherishchen 2006-11-23
The framework uses a number of properties that can be changed to fit your needs. To change any of these properties, specify the property key and 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 Configuration

Constants provide a simple way to customize a Struts application by defining key settings that modify framework and plugin behavior. There are two key roles for constants. First, they are used to override settings like the maximum file upload size or whether the Struts framework 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, constants are searched for in the following order, allowing for subsequent files to override previous ones:

  1. struts-default.xml
  2. struts-plugin.xml
  3. struts.xml
  4. struts.properties
  5. 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 the ParametersInterceptor so that the static parameters may be set as the defaults and overridden by the request parameters.


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多