在Maven Web项目中,JSP,JavaScript,CSS,图像的常规位置是什么? [英] What are the conventional locations for for JSPs, JavaScript, CSS, Images in Maven web projects?

查看:223
本文介绍了在Maven Web项目中,JSP,JavaScript,CSS,图像的常规位置是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将传统的J2EE Web应用程序转换为新的Maven Web项目。在传统项目中,JSP位于 WebApp / jsps 文件夹,JavaScript& WebApp / scripts 文件夹下的CSS文件, WebApp / images 文件夹下的图像, .properties WebApp / resources 文件夹下的文件。

I need to convert a traditional J2EE web application into a new Maven web project. In traditional project JSPs are under WebApp/jsps folder, JavaScript & CSS files under WebApp/scripts folder, image under WebApp/images folder, .properties files under WebApp/resources folder.

在Maven项目中,每个文件都在哪里文件类型去?我应该在 src / main / webapp 下创建文件夹,例如: src / main / webapp / jsps src / main / webapp / images src / main / webapp / resources …等从旧项目中复制文件?或者是否有任何标准结构可供使用?

In the Maven project where would each of those file types go? Should I create folders under src/main/webapp such as: src/main/webapp/jsps, src/main/webapp/images, src/main/webapp/resources … etc and copy the files from old project? Or is there any standard structure to follow?

推荐答案

看看这篇文章关于maven war插件的用法。它有一个简单的项目结构。

Take a look at this article on the usage of the maven war plugin. It has a simple project structure.

从上面的链接引用,

 |-- pom.xml  
 `-- src
     `-- main
         |-- java
         |   `-- com
         |       `-- example
         |           `-- projects
         |               `-- SampleAction.java
         |-- resources
         |   `-- images
         |       `-- sampleimage.jpg
         |   `-- js
         |       `-- scripts.js
         |   `-- css
         |       `-- styles.css
         `-- webapp
             |-- WEB-INF
             |   `-- web.xml
             |-- index.jsp
             `-- jsp
                 `-- websource.jsp

这篇关于在Maven Web项目中,JSP,JavaScript,CSS,图像的常规位置是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆