关于 `jersey.config.server.provider.scanning.recursive` 参数,我应该考虑什么?
What should I take into consideration regarding the `jersey.config.server.provider.scanning.recursive` parameter?
根据 Building, Packaging, and Deploying RESTful Web Service Applications 的 Oracle 文档,有一个参数 jersey.config.server.provider.scanning.recursive
可用于修改 servlet 配置。
web.xml 文件的示例,如果扩展 javax.ws.rs.core.Application
的 class 未打包。这适用于 3.0 之前的 Servlet:
<web-app>
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>org.foo.myresources,org.bar.otherresources</param-value>
</init-param>
<init-param>
<param-name>jersey.config.server.provider.scanning.recursive</param-name>
<param-value>false</param-value>
</init-param>
...
</servlet>
...
</web-app>
现在,没有任何文档解释这个参数的作用和使用方法。
问题:
那么,在构建、打包和部署 RESTful Web 服务应用程序时,关于 jersey.config.server.provider.scanning.recursive
参数我应该考虑什么?
在球衣 github 项目 (jersey/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java#L108) 中有一个正式的描述 属性:
Sets the recursion strategy for package scanning.
The value oftrue
indicates that the list of provided package
names should be scanned recursively including any nested packages.
Value of false
indicates that only packages in the list should be
scanned. In such case any nested packages will be ignored.
The property value MUST be an instance of Boolean
type or a String
convertible to Boolean
type.
A default value is true
.
根据 Building, Packaging, and Deploying RESTful Web Service Applications 的 Oracle 文档,有一个参数 jersey.config.server.provider.scanning.recursive
可用于修改 servlet 配置。
web.xml 文件的示例,如果扩展 javax.ws.rs.core.Application
的 class 未打包。这适用于 3.0 之前的 Servlet:
<web-app>
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>org.foo.myresources,org.bar.otherresources</param-value>
</init-param>
<init-param>
<param-name>jersey.config.server.provider.scanning.recursive</param-name>
<param-value>false</param-value>
</init-param>
...
</servlet>
...
</web-app>
现在,没有任何文档解释这个参数的作用和使用方法。
问题:
那么,在构建、打包和部署 RESTful Web 服务应用程序时,关于 jersey.config.server.provider.scanning.recursive
参数我应该考虑什么?
在球衣 github 项目 (jersey/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java#L108) 中有一个正式的描述 属性:
Sets the recursion strategy for package scanning.
The value of
true
indicates that the list of provided package names should be scanned recursively including any nested packages. Value offalse
indicates that only packages in the list should be scanned. In such case any nested packages will be ignored.The property value MUST be an instance of
Boolean
type or aString
convertible toBoolean
type.A default value is
true
.