1.添加jar包
jersey-bundle-1.18.jar
jersey-common-2.21.jar
jersey-server-1.19.3.jar
jersey-spring-1.19.3.jar
jsr311-api-1.1.1.jar
2.修改配置文件
spring beans:
<bean id="msgService" class="com.message.ws.MessageWsImpl" />web
web.xml
<servlet>
<servlet-name>JerseyServlet</servlet-name>
<servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>JerseyServlet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
3.類
@Path("/messageService")
public class MessageWsImpl implements IMessageWs{
@Path("/receiveMsg")
@POST
public void receiveMsg(){
System.out.println("123123");
}
}spring