1、环境准备sts 【相当于eclipse】、maven、tomcat
2、简述:创建maven web工程有三种方法,
第一种使用命令行创建,然后转换成兼容eclipse工程
mvn archetype:create -DgroupId=xxxxx -DartifactId=web-sample -DarchetypeArtifactId=maven-archetype-webapp
mvn eclipse:eclipse
第二种使用eclipse创建maven工程,然后转换成web工程,需要手动修改一些目录,最终效果与第三种相同,步骤较多
第三种使用sts创建maven webapp 工程,比较快速,下面详解
步骤:
1、创建maven 工程
![](/attachment/201508/9/29160570_14391275636DVT.png)
![](/attachment/201508/9/29160570_1439127632DWOu.png)
![](/attachment/201508/9/29160570_1439127682i3If.png)
![](/attachment/201508/9/29160570_1439127745kdAG.png)
2、修改工程配置,右键工程properties【alt+enter】
![](/attachment/201508/9/29160570_1439127853t0wm.png)
3、buildpath ,有两个missing不明白为什么默认创建的少资源文件夹,没关系,少了增加上就好
![](/attachment/201508/9/29160570_1439128080V0P1.png)
操作说明:双击missing进入编辑,next,add,输入资源文件目录,ok,查看工程多了两个资源文件夹
![](/attachment/201508/9/29160570_1439128266rDrd.png)
4、index.jsp 是自动生成的文件,右键 run on server
![](/attachment/201508/9/29160570_1439128392LCg2.png)
![](/attachment/201508/9/29160570_1439128417Ar5q.png)
ok,初步创建完成,验证没有问题。
2、简述:创建maven web工程有三种方法,
第一种使用命令行创建,然后转换成兼容eclipse工程
mvn archetype:create -DgroupId=xxxxx -DartifactId=web-sample -DarchetypeArtifactId=maven-archetype-webapp
mvn eclipse:eclipse
第二种使用eclipse创建maven工程,然后转换成web工程,需要手动修改一些目录,最终效果与第三种相同,步骤较多
第三种使用sts创建maven webapp 工程,比较快速,下面详解
步骤:
1、创建maven 工程
![](/attachment/201508/9/29160570_14391275636DVT.png)
![](/attachment/201508/9/29160570_1439127632DWOu.png)
![](/attachment/201508/9/29160570_1439127682i3If.png)
![](/attachment/201508/9/29160570_1439127745kdAG.png)
2、修改工程配置,右键工程properties【alt+enter】
![](/attachment/201508/9/29160570_1439127853t0wm.png)
3、buildpath ,有两个missing不明白为什么默认创建的少资源文件夹,没关系,少了增加上就好
![](/attachment/201508/9/29160570_1439128080V0P1.png)
操作说明:双击missing进入编辑,next,add,输入资源文件目录,ok,查看工程多了两个资源文件夹
![](/attachment/201508/9/29160570_1439128266rDrd.png)
4、index.jsp 是自动生成的文件,右键 run on server
![](/attachment/201508/9/29160570_1439128392LCg2.png)
![](/attachment/201508/9/29160570_1439128417Ar5q.png)
ok,初步创建完成,验证没有问题。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29160570/viewspace-1766486/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29160570/viewspace-1766486/