创建一个入门的JAVA WEB站点(REST JERSEY)
2013-08-14 15:32
501 查看
最近一直在看TOMCAT,想要自己创建一个小WEB站点,有不想要部署在其他的容器内这是一个不错的学习对象。
一、选择合适的模版
二、选择模版
三、填入信息
四、进入目录,编译
五、执行程序: mvn exec:java
六、测试结果,访问:http://localhost:9998/myresource 和 http://localhost:9998/application.wadl
From: /article/1664291.html
一、选择合适的模版
mvn archetype:generate -DarchetypeCatalog=http://download.java.net/maven/2
二、选择模版
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-grizzly (Archetype for creating a RESTful web application with Jersey and Grizzly) 2: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-grizzly2 (Archetype for creating a RESTful web application with Jersey and Grizzly 2.x) 3: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-webapp (Archetype for creating a Jersey based RESTful web application with WAR packaging) 4: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-ejb (Archetype for creating a Jersey based RESTful EJB application with WAR packaging) 5: http://download.java.net/maven/2 -> com.sun.faces:simple-jsf (Archetype for creating a simple JSF project) 6: http://download.java.net/maven/2 -> com.sun.faces.regression:i_jsf_XXXX-archetype (Archetype for mojarra JSF regression tests)
三、填入信息
Define value for property 'groupId': : com.esri Define value for property 'artifactId': : carrier Define value for property 'version': 1.0-SNAPSHOT: : Define value for property 'package': com.esri: : Confirm properties configuration: groupId: com.esri artifactId: carrier version: 1.0-SNAPSHOT package: com.esri Y: : y
四、进入目录,编译
$ cd carrier $ mvn clean package
五、执行程序: mvn exec:java
$ mvn exec:java [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.taobao:carrier:jar:1.0-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 63, column 21 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building carrier 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> exec-maven-plugin:1.1:java (default-cli) @ carrier >>> [INFO] [INFO] <<< exec-maven-plugin:1.1:java (default-cli) @ carrier <<< [INFO] [INFO] --- exec-maven-plugin:1.1:java (default-cli) @ carrier --- Starting grizzly... 2013-8-14 15:30:05 com.sun.grizzly.Controller logVersion 信息: GRIZZLY0001: Starting Grizzly Framework 1.9.31 - 13-8-14 下午3:30 Jersey app started with WADL available at http://localhost:9998/application.wadl Hit enter to stop it...
六、测试结果,访问:http://localhost:9998/myresource 和 http://localhost:9998/application.wadl
From: /article/1664291.html
相关文章推荐
- Jersey入门三:创建一个JavaEE的Web项目
- JAVA RESTful Web Services - Jersey 入门
- 在ASP.NET MVC中创建一个统一布局的Web页面站点
- JAVA学习中使用Eclipse创建一个动态的WEB项目
- java web 如何创建一个可供访问的文件(通过url访问)
- 用intellij idea 11创建一个Java Web项目
- django创建一个简单的web站点
- JavaWeb从入门到放弃(9)-实现一个客户端上传文件到服务端
- Sun Java Studio Enterprise 实践:创建一个 Web 应用程序
- 使用Eclipse EE(汉化版) 创建一个JavaWeb工程
- Java入门之Maven创建Web项目
- 用IDEA创建一个Javaweb项目
- Python web入门:Django学习与实践二(简单页面实现和创建一个模板)
- 【Spring】官网教程阅读笔记(一):创建一个符合REST规范的web服务
- JAVA学习中使用Eclipse创建一个动态的WEB项目
- 【Java_SSM】(二)使用eclipse创建一个Maven web工程
- Java web 开发填坑记 2 -如何正确的创建一个Java Web 项目
- vs2005入门 之 起始页与创建WEB站点和创建新页面[视频]
- 使用idea和maven创建一个java web项目
- Maven 3 入门 -- 如何创建一个web应用程序