[struts 2] configuration file

abstract

In struts 2, there are multiple configuration files, properties or XML files. What is their loading order?

configuration file

Struts 2 has the following configuration files, which are loaded in the following order

1、default. properties

In this configuration file, the constants of struts 2 are configured.

The location of the configuration is shown in the figure.

For example:

struts.action.extension=action,:该常量配置访问struts2的action的扩展名,在这里默认的配置为action和空,那么你可以通过xxx.action和xxx访问定义的action。
struts.multipart.maxSize=2097152:上传文件的大小限制。
struts.serve.static.browserCache=true:是否卡其浏览器缓存静态内容。
struts.enable.DynamicMethodInvocation = false:是否开启动态方法调用。

2、struts-default. xml

file location

This file is configured with struts The result type in XML can be used to determine whether the action result is jump or forward through the value configured above.

In addition, the default interceptor and interceptor stack are configured here.

3、struts-plugin. xml

file location

This configuration is mainly a plug-in configuration.

4、struts. xml

This file is the default struts configuration file for web applications. It is mainly responsible for managing the action mapping in the application and the result definition contained in the action

Stored in the SRC directory, you can include other packages XML configuration files (if there are many, you can put the configuration files belonging to the package in the package and include them in struts.xml).

You can configure constants for default Properties.

5、struts. properties

It is the default configuration file of struts. You can set the default Modify the constants in the properties file.

6、web. xml

The configuration file of the web application.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>