简体   繁体   中英

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.

Example of web.xml file if a class that extends javax.ws.rs.core.Application is not packaged. This is for Pre-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?

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:

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 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM