自定义struts.xml的位置

北慕城南 提交于 2020-01-26 10:18:19
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
    <filter>
        <filter-name>struts</filter-name>
        <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
        <!--自定义struts.xml的位置-->
        <init-param>
        	<!--固定名字是config-->
            <param-name>config</param-name>
            <!--struts-default.xml,struts-plugin.xml是strut的会默认加载的配置文件,spring_hibernate/struts.xml是自己项目下struts.xml的位置-->
            <param-value>struts-default.xml,struts-plugin.xml,spring_hibernate/struts.xml</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>struts</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!