tandaica0612
tandaica0612

Reputation: 371

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

I want to know how to change default location of struts.xml in Struts 2?
Thank for your help!

Upvotes: 0

Views: 2820

Answers (3)

Dave Newton
Dave Newton

Reputation: 160191

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

Upvotes: 3

Zeeno
Zeeno

Reputation: 2721

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

Upvotes: 1

Thomas
Thomas

Reputation: 88707

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)

Upvotes: 2

Related Questions