java – Eclipse Dynamic Web Project如何组织文件?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了java – Eclipse Dynamic Web Project如何组织文件?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1741字,纯文字阅读大概需要3分钟。
内容图文
所以我正在学习Web应用程序开发,我对如何在eclipse for Dynamic Web Application提供的模板中组织我的文件感到困惑.
我应该将我的HTML页面放在WebContent中吗?我在哪里放置JSP和servlet源文件?全球遵循什么样的惯例?
这是eclipse提供的模板结构
>部署描述符
> JavaScript资源
> WebContent
> ECMAScript内置库
> ECMA 3浏览器支持库
> src
> JRE系统库
> Apache Tomcat v8
> Web App库
> EAR图书馆
>构建
> WebContent
> META-INF
> WEB-INF
> lib
解决方法:
将HTML和JSP页面放在WebContent目录中.
Eclipse帮助页面referenced by android-weblineindia声明WebContent是:
The mandatory location of all Web resources, including HTML, JSP, graphic files, and so on. If the files are not placed in this directory (or in a subdirectory structure under this directory), the files will not be available when the application is executed on a server. The Web content folder represents the contents of the WAR file that will be deployed to the server. Any files not under the Web content folder are considered development-time resources (for example, .java files, .sql files, and .mif files), and are not deployed when the project is unit tested or published.
所以浏览器所需的CSS文件和JS文件也应该放在这里.
将java源文件(包括servlet源)放在src目录中.相同的帮助页面为源目录指出了这一点(虽然它表明它被称为JavaSource,看起来像文档中的错误):
Contains the project’s Java source code for classes, beans, and servlets. When these resources are added to a Web project, they are automatically compiled and the generated files are added to the WEB-INF/classes directory. The contents of the source directory are not packaged in WAR files unless an option is specified when a WAR file is created.
如果你看项目属性 – >部署程序集您应该看到从src编译的文件部署到WEB-INF / classes,WebContent中的文件部署到WAR文件的根目录
内容总结
以上是互联网集市为您收集整理的java – Eclipse Dynamic Web Project如何组织文件?全部内容,希望文章能够帮你解决java – Eclipse Dynamic Web Project如何组织文件?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。