我正在学习 Java EE,我正在使用的书上说 Web 应用程序的标准目录结构是:
MyApp/:Here, the view of my App (Resources that can be directly requested)
.xhtml Files
.jsp Files
MyApp/WEB-INF:
web.xml file for deployment instructions of the webapp
MyApp/WEB-INF/lib:
Here, the external jars (API, Frameworks,etc) used by the webapp
MyApp/WEB-INF/classes:
.class Files (Compiled classes for my webapp)
这是完美的工作。但是,现在,我开始为 JEE 使用 eclipse。我创建了一个动态 Web 项目。生成的项目结构目录为:
MyApp/
MyApp/build
MyApp/src
MyApp/WebContent
MyApp/WebContent/META-INF
MyApp/WebContent/WEB-INF
MyApp/WebContent/WEB-INF/lib
是的,上面的也行。但是,为什么 eclipse 不遵循规范?服务器(Apache tomcat)是否知道各种类型的目录结构?我在哪里可以学习它们?
提前致谢
最佳答案
如果您在 eclipse
中右键单击您的 Web 应用程序项目,然后选择 Properties
,可用的部分之一是 Deployment Assembly
。通过此部分,您可以为 Eclipse 提供有关应将哪些文件部署到 Tomcat
目录的自定义信息。
关于java - 标准java web应用目录结构与Eclipse生成的目录结构的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41731696/