Search code examples
struts2strutsstruts-1

Regarding Struts configuration files


Where do we need to put the struts configuration files in a web application? And, what is the differences between struts.xml and struts-config.xml? For Struts 2 applications, which one we should use?

Thanks.


Solution

  • As indicated in Vinodh's link, struts.xml is the default name of the configuration file in Struts2. struts-config.xml is a Struts1 configuration file, and should not be used in Struts2.

    Your struts.xml file should be at the root of your class path so that once your web app is built, it will be located in WEB-INF/classes. You can accomplish this by placing it in your source folder. If you use the Maven 2 Standard Directory Layout, then you would place it in src/main/resources.