开发者

How to change default location of struts.xml in Struts 2?

I want to know how to change defaul开发者_StackOverflow社区t location of struts.xml in Struts 2?

Thank for your help!


To answer the question, the filter configuration accepts a "config" parameter that specifies the location(s) of S2 configuration files:

https://struts.apache.org/docs/webxml.html

http://struts.apache.org/2.x/docs/webxml.html


Did you have a look at the documentation?

Here it says that struts.xml should reside on the classpath of the webapp, so the location shouldn't matter, as long as it is in the classpath.

Additional link: http://struts.apache.org/2.x/docs/struts-1-solutions.html (Note that although it says Struts 1 Solutions it talks about Struts 2 - it's more of a migration guide)


Struts only needs to be in the class path of the webapp. Its location is irrelevant.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜