我正在尝试使用Tomcat7获得RESTful Web服务(JAX-RS).我尝试了3种不同的实现(Jersey,RESTeasy和Restlet)但没有成功.这应该很容易,但不知何故不是.我正在寻找注释,web.xml和示例代码的最新教程/文档.
我在 Tomcat 7 中使用 Apache Wink 和 Jersey,没有任何问题。
在 web.xml 我有:
<servlet>
<servlet-name>restSdkService</servlet-name>
<!-- When running with Jersey use the following class: com.sun.jersey.spi.container.servlet.ServletContainer -->
<!-- When running with Wink use the following class: org.apache.wink.server.internal.servlet.RestServlet -->
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>mypackage.MyApplication</param-value>
</init-param>
</servlet>
Run Code Online (Sandbox Code Playgroud)
也许您应该详细说明您遇到的问题/异常。
| 归档时间: |
|
| 查看次数: |
16845 次 |
| 最近记录: |