当我们想把struts.xml放在非src目录下时,需要在web.xml文件中配置struts2过滤器注入值config,比如把配置文件放在com.luo.config包下,配置如下
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>struts-default.xml,struts-plugin.xml,com/luo/config/struts.xml</param-value>
</init-param>
</filter>
不知道为什么在自己的配置文件路径前加classpath 会找不到该文件