Alex Rivera | Logout

Where to put struts.xml

Asked 2009-05-15T18:55:04.373
20

With Struts2 we have to have struts.xml in the class path, so it no longer works to have it under WEB-INF. So the way I got my project to deploy was to stick it under WEB-INF/classes and have it include ../struts2.xml

2 Problems:

  1. Eclipse cleans out the classes folder when I do a rebuild, so it deletes struts.xml
  2. Eclipse doesn't show the classes folder in my project browser, so its a poor place to stick config files in the first place.

How are you Struts2 Eclipse developers doing this?

Edit
Report

1 Answer

1

I am not using Eclipse so this answer is not specific to your requirements but, I use Maven so we have all the "resources" that are needed by the application in a seperate folder called "resources" and When the application is built these files are copied into the appropriate places automatically. In Netbeans the files in the folder are available and I know that there are persons using eclipse with a similar setup.

I should point out that our project started from appfuse so most of these configurations were pre made. You can look at how it was done there.

answered 2009-05-15T19:11:40.387

Your Answer