[英]What should I take into consideration regarding the `jersey.config.server.provider.scanning.recursive` parameter?
According to the Oracle documentation for Building, Packaging, and Deploying RESTful Web Service Applications there is a parameter jersey.config.server.provider.scanning.recursive
that can be used to modify the servlets configurations. According to the Oracle documentation for Building, Packaging, and Deploying RESTful Web Service Applications there is a parameter
jersey.config.server.provider.scanning.recursive
that can be used to modify the servlets configurations.
Example of web.xml file if a class that extends javax.ws.rs.core.Application
is not packaged.如果扩展
javax.ws.rs.core.Application
的 class 未打包,则 web.xml 文件的示例。 This is for Pre-3.0 Servlets:这适用于 3.0 之前的 Servlets:
<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>
Now, there is not any documentation explaining exactly what does this parameter does and how to use it.现在,没有任何文档准确解释此参数的作用以及如何使用它。
Question:问题:
So, what should I take into consideration regarding the jersey.config.server.provider.scanning.recursive
parameter when Building, Packaging, and Deploying RESTful Web Service Applications?那么,在构建、打包和部署 RESTful Web 服务应用程序时,关于
jersey.config.server.provider.scanning.recursive
参数我应该考虑什么?
Inside the jersey github project ( jersey/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java#L108 ) there is a formal description for this property:在 jersey github 项目( jersey/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java#L108 )中有一个正式的描述:
Sets the recursion strategy for package scanning.
设置 package 扫描的递归策略。
The value of
true
indicates that the list of provided package names should be scanned recursively including any nested packages.值
true
表示应递归扫描提供的 package 名称列表,包括任何嵌套包。 Value offalse
indicates that only packages in the list should be scanned.值为
false
表示仅应扫描列表中的包。 In such case any nested packages will be ignored.在这种情况下,任何嵌套的包都将被忽略。
The property value MUST be an instance of
Boolean
type or aString
convertible toBoolean
type.属性值必须是
Boolean
类型的实例或可转换为Boolean
类型的String
。A default value is
true
.默认值为
true
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.