簡體   English   中英

關於 `jersey.config.server.provider.scanning.recursive` 參數,我應該考慮什么?

[英]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.

如果擴展javax.ws.rs.core.Application的 class 未打包,則 web.xml 文件的示例。 這適用於 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>

現在,沒有任何文檔准確解釋此參數的作用以及如何使用它。

問題:

那么,在構建、打包和部署 RESTful Web 服務應用程序時,關於jersey.config.server.provider.scanning.recursive參數我應該考慮什么?

在 jersey github 項目( jersey/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java#L108 )中有一個正式的描述:

設置 package 掃描的遞歸策略。

true表示應遞歸掃描提供的 package 名稱列表,包括任何嵌套包。 值為false表示僅應掃描列表中的包。 在這種情況下,任何嵌套的包都將被忽略。

屬性值必須是Boolean類型的實例或可轉換為Boolean類型的String

默認值為true

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM