The core configuration file for the framework is the default (
struts.xml) file and should reside on the classpath of the webapp (generally
- The default file may include other configuration files as needed.
struts-plugin.xmlfile can be placed in a JAR and automatically plugged into an application, so that modules can be self-contained and automatically configured.
- In the case of Freemarker and Velocity modules, the templates can also be loaded from the classpath, so the entire module can be plugged in as a single JAR.
Can we break up a large struts.xml file into smaller pieces?
Could we add something about the expected location of the struts.xml file? I spent endless hours trying to get Struts2 to work. If something like the following had appeared here in the documentation I might still have hair left.
struts.xml is expected to be on the web application's classpath. It can be placed in WEB-INF/classes or packaged in the root of a jar and placed in WEB-INF/lib.
Sorry, I didn't realize the Configuration Files page has this information. I swear it wasn't there yesterday even though it shows a last edit date of Feb 12, 2007.
But having this information here would still be helpful. It would be nice if the web.xml, struts.properties pages also had the expected location stated.
Added info regarding struts.xml location; thanks for the feedback.
struts.propertieshas been largely replaced with XML configuration so I'm leaving that out.
web.xmlis a JEE file so I'm leaving that out as well.