Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们需要将 struts 配置文件放在 Web 应用程序的什么位置?而且,struts.xml 和 struts-config.xml 有什么区别?对于 Struts 2 应用程序,我们应该使用哪一个?
谢谢。
如 Vinodh 的链接所示,struts.xml是 Struts2 中配置文件的默认名称。struts-config.xml是 Struts1 的配置文件,不应在 Struts2 中使用。
struts.xml
struts-config.xml
您的struts.xml文件应该位于类路径的根目录下,这样一旦构建了 Web 应用程序,它将位于 WEB-INF/classes 中。您可以通过将其放在源文件夹中来完成此操作。如果你使用 Maven 2 标准目录布局,那么你应该把它放在 src/main/resources 中。