码迷,mamicode.com
首页 > Web开发 > 详细

WebService 服务端的XML配置

时间:2015-01-23 15:50:45      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
 3   <servlet>
 4     <description>JAX-RS Tools Generated - Do not modify</description>
 5     <servlet-name>JAX-RS Servlet</servlet-name>
 6     <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
 7     <init-param>
 8       <param-name>com.sun.jersey.config.property.packages</param-name>
 9       <param-value>org.blog.ccnu.edu.webservice</param-value>
10     </init-param>
11     <load-on-startup>1</load-on-startup>
12   </servlet>
13   <servlet-mapping>
14     <servlet-name>JAX-RS Servlet</servlet-name>
15     <url-pattern>/jaxrs/*</url-pattern>
16   </servlet-mapping>
17 </web-app>

此处的url-pattern得注意了 它拦截后 我们在service配置的@path就把之前的略去,

比如localhost:8080/blog/jaxrs/userInfo/getUserInfoByUserName/

拦截后 我门自动找的path变为userInfo/getUserInfoByUserName/

如果我的url-pattern改成/* 那么拦截后找的path就变为jaxrs/userInfo/getUserInfoByUserName/

WebService 服务端的XML配置

标签:

原文地址:http://www.cnblogs.com/keitho00/p/4244163.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!