转载请注明出处,谢谢 http://blog.csdn.net/exsuns
新建一个web工程:
新建类com.Hello.java ,内容如下
最后部署到服务器,并启动
客户端:
打开客户端进行测试,就会在出现结果。
get/post/delete/put 都会出现结果
不过head有可能不会出现
关于head请求,sun有一句话
By default the JAX-RS runtime will automatically support the methods HEAD, if not explicitly implemented. For HEAD the runtime will invoke the implemented GET method (if present) and ignore the response entity (if set).
默认请况下 jax-rs运行时会自动支持head和options请求,如果没有明确实现,head运行时会调用get,同时会忽略response写出