Java Jersey web.xml文件<;初始参数>;
我不熟悉使用Java Jersey web.xml文件<;初始参数>;,java,rest,jersey,web.xml,Java,Rest,Jersey,Web.xml,我不熟悉使用Jersey的REST服务 我的项目名为:cs9322.simple.rest.books.resources 我对包含以下部分的web.xml文件有疑问: <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>cs9322.simple.rest.books.resources</para
Jersey
的REST
服务
我的项目名为:cs9322.simple.rest.books.resources
我对包含以下部分的web.xml
文件有疑问:
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>cs9322.simple.rest.books.resources</param-value>
</init-param>
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
com.sun.jersey.config.property.packages
cs9322.simple.rest.books.resources
泽西岛休息服务
/休息/*
我发现即使我改变了:
<param-value>cs9322.simple.rest.books.resources</param-value>
cs9322.simple.rest.books.resources
到
cs9322.simple.rest.books
我仍然需要通过URL
:cs9322.simple.rest.books.resources/rest/*
我不明白cs9322.simple.rest.books.resources
到底指的是什么,因为服务的基本url
似乎总是项目名称
,不受
的影响
有人能给我解释一下
指的是什么吗
感谢您的帮助。cs9322.simple.rest.books.resources
<param-value>cs9322.simple.rest.books.resources</param-value>
或
cs9322.simple.rest.books
与您的REST服务URL没有关系。上述参数用于扫描jersey framework将作为REST服务公开的文件
它是访问REST服务URL时使用的项目/web上下文的名称。因此,您的web上下文似乎是cs9322.simple.rest.books.resources
,因此您必须将其用作基本URL
<param-value>cs9322.simple.rest.books.resources</param-value>
<param-value>cs9322.simple.rest.books</param-value>