创建一个入门的JAVA WEB站点(REST JERSEY)
最近一直在看TOMCAT,想要自己创建一个小WEB站点,有不想要部署在其他的容器内这是一个不错的学习对象。
一、选择合适的模版
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: http://blog.csdn.net/csfreebird/article/details/8152437
创建一个入门的JAVA WEB站点(REST JERSEY)的更多相关文章
- 使用eclipse创建一个简单的Java Web应用程序
关于Java JDK/JRE.Tomcat的配置等等都没什么好说的,主要记录一下使用Eclipse创建web工程时的一些点以及说一说自己用IDEA的创建失败的过程(IDEA没运行成功...暂时不想弄了 ...
- 一个简单的Java web服务器实现
前言 一个简单的Java web服务器实现,比较简单,基于java.net.Socket和java.net.ServerSocket实现: 程序执行步骤 创建一个ServerSocket对象: 调用S ...
- WebLech是一个功能强大的Web站点下载与镜像工具
WebLech是一个功能强大的Web站点下载与镜像工具.它支持按功能需求来下载web站点并能够尽可能模仿标准Web浏览器的行为.WebLech有一个功能控制台并采用多线程操作. http://sour ...
- SharePoint创建一个简单的Visio Web部件图
SharePoint创建一个简单的Visio Web部件图 Visio有很多强大的Mash-up混聚功能,使它能够轻松集成到SharePoint 2010中. 1. 打开Visio 2010,创建新的 ...
- 一个简单的Java Web项目搭建流程
今天试图在服务器上搭建一个web服务器,顺便回顾了java web项目的入门,使用Servlet处理HTTP请求,并记录日志等操作.当很久没有做过web项目时,有些东西还是很容易忘记的. Maven配 ...
- 图文具体解释 IntelliJ IDEA 15 创建 Maven 构建的 Java Web 项目(使用 Jetty 容器)
图文具体解释 IntelliJ IDEA 15 创建 maven 的 Web 项目 搭建 maven 项目结构 1.使用 IntelliJ IDEA 15 新建一个项目. 2.设置 GAV 坐标 3. ...
- 高性能、高流量Java Web站点打造的22条建议
@http://www.csdn.net/article/2013-12-20/2817861-22-recommendations-for-building-effective-high-traff ...
- 图文详解 IntelliJ IDEA 15 创建 Maven 构建的 Java Web 项目(使用 Jetty 容器)
图文详解 IntelliJ IDEA 15 创建 maven 的 Web 项目 搭建 maven 项目结构 1.使用 IntelliJ IDEA 15 新建一个项目. 2.设置 GAV 坐标 3. ...
- IDEA创建Maven项目做Java Web时无WEB-INF/classes的问题
昨天开始学习Java Web中的Servlet,学到用IntelliJ IDEA创建Java Web项目时,跟着课程上老师的步骤一步步做,却发现运行时Servlet找不到.坑爹的是,练习建项目时,一模 ...
随机推荐
- 如何调试 Android 上 HTTP(S) 流量
http://greenrobot.me/devpost/how-to-debug-http-and-https-traffic-on-android/ 如何调试 Android 上 HTTP(S) ...
- 技术人生:Knowing when or where it’s appropriate to use a technique or tool is just as important as knowing how to use it.
Knowing when or where it’s appropriate to use a technique or tool is just as important as knowing ho ...
- ASP.NET MVC:如何提供 Controller 继承体系使用的 ModelBinder?
背景 Mvc 提供了一种可扩展的模型绑定机制,具体来说就是:将客户端传递的参数按照一定的策略绑定到 action 的参数上,这带来的直接好处就是让 action 的参数支持强类型.一般来说我们有如下方 ...
- struct net_device网络设备结构体详解
转自:http://blog.csdn.net/viewsky11/article/details/53046787 在linux中使用struct net_device结构体来描述每一个网络设备.同 ...
- 解决org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource
spring中做成bean,可以使用property"resourceLoaderPath"指定工程中的路径 <bean id="velocityEngine&qu ...
- maven 阿里仓库
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3. ...
- SpringBoot 项目中使用velocity模板(转载)
(不要使用这种模板了,spring boot最新版已经不支持了.使用FreeMarker吧:http://blog.csdn.net/clementad/article/details/5194262 ...
- Excel 2016 Power View选项卡不显示的问题
https://zhuanlan.zhihu.com/p/43543442 PowerView是Excel中的Power系列插件之一,可以基于excel制作交互式仪表板. 初学者在使用Power Vi ...
- SpringMVC request生命周期
When the request leaves the browser, it carries information about what the user is asking for. At ve ...
- [leetcode]Trapping Rain Water @ Python
原题地址:https://oj.leetcode.com/problems/trapping-rain-water/ 题意: Given n non-negative integers represe ...