本文介绍了我可以将struts.xml文件更改为其他文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我通过struts2时,我遇到了一个典型的问题.问题是我可以将struts.xml
文件的名称更改为其他名称并使其起作用吗?
When I'm going though struts2, I came through a typical question.The question is that can I change the name of struts.xml
file to some other thing and make it work?
推荐答案
您可以使用web.xml
<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>my-new-struts-config-file.xml,struts-plugin.xml,struts.xml</param-value>
</init-param>
</filter>
此外,如果您使用struts.properties
,则可以执行以下操作:
Also, if you use the struts.properties
you can do something like:
struts.configuration.files=my-new-struts-config-file.xml,struts-plugin.xml,struts.xml
这篇关于我可以将struts.xml文件更改为其他文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!