bharanitharan
bharanitharan

Reputation: 2629

where to place the struts.xml file

I need to know...where we have to place the struts.xml file...Is there any possibilities of changing the location of struts.xml file

Upvotes: 0

Views: 3164

Answers (2)

Sudeep Devkota
Sudeep Devkota

Reputation: 209

If you have a simple dynamic web project, I recommend putting it under the src folder. This is because it simply works. You can create a classes folder underneath the WEB-INF folder and move it there as well.

Upvotes: 1

Lauri Lehtinen
Lauri Lehtinen

Reputation: 10857

By default, it is looked for in the classpath's root level.

Place yours directly under WEB-INF/classes (or to a place where someone/something grabs it and puts it there, typically the root of a source folder, such as src/main/resources if you are using Maven).

Another option would be to have it packaged at the root level of a JAR in your WEB-INF/lib. A struts.xml in WEB-INF/classes gets precedence though. I have yet to come across an example where this option would make sense though.

Upvotes: 4

Related Questions