精华帖 (0) :: 良好帖 (0) :: 新手帖 (2) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2010-09-19
在看完了Maven权威的前五章以后,我又重新回到了Jetty的学习,刚刚把这两个Jetty的用Maven构建的例子运行完毕。 http://wiki.eclipse.org/Jetty/Tutorial/Jetty_and_Maven_HelloWorld
第一个例子:Configuring Embedded Jetty with Maven #1 使用mvn的archetype构建项目的骨架 mvn archetype:create -DgroupId=com.licanjing.jetty.study -DartifactId=helloWorld -DpackageName=com.licanjing.jetty.study -Dversion=1.0 删除App.java和AppTest.java #3 在pom.xml中加入对jetty-server和servlet的依赖和exec: <dependencies> <dependency> #4 运行 mvn clean compile exec
:java
#5 在浏览器查看结果:http://localhost:8080/
第二个例子:Developing a Standard WebApp with Jetty and Maven #1使用mvn archetype创建web app的骨架 mvn archetype:create -DgroupId=com.licanjing.jetty.study -DartifactId=helloWebApp -Dpackage=com.licanjing.jetty.study -DarchetypeArtifactId=maven-archetype-webapp #2 删除index.jsp, 创建index.html 原文中好像有点错误,html里面应该为: <h1>Hello World Webapp</h1>
#3 创建HelloServlet.java #4 修改web.xml #5 修改pom.xml <dependencies>
#6 运行mvn jetty:run #7 在浏览器中查看结果 http://localhost:8080/helloWebApp/
声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
浏览 2710 次