现在的位置: 首页 > 综合 > 正文

Struts2 WEB项目启动时候的三个xml文件

2017年11月14日 ⁄ 综合 ⁄ 共 884字 ⁄ 字号 评论关闭

使用tomcat部署struts2 web项目时候,在日志中:

信息: Parsing configuration file [struts-default.xml]
2014-3-19 0:50:17 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info
信息: Unable to locate configuration files of the name struts-plugin.xml, skipping
2014-3-19 0:50:17 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info
信息: Parsing configuration file [struts-plugin.xml]
2014-3-19 0:50:18 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info
信息: Parsing configuration file [struts.xml]
2014-3-19 0:50:18 org.apache.struts2.config.AbstractBeanSelectionProvider info

1.struts-default.xml

只读文件,是struts的核心配置文件

2.struts-plugin.xml

框架中使用到的插件,通常在struts lib 目录下面以plugin结尾的jar包。

比如json,配置文件如下:

<struts>
    <package name="json-default" extends="struts-default">

        <result-types>
            <result-type name="json" class="org.apache.struts2.json.JSONResult"/>
        </result-types>

        <interceptors>

3.struts.xml

自己定义的配置文件,自己定义的Action,拦截器等。

抱歉!评论已关闭.