谁将在基于 JERSY 2.0 的应用程序中创建 WADL 文件

Who will create WADL file in Application based on JERSY 2.0

因为我可以自动访问我的应用程序的 WADL 文件,而无需进行任何手动操作,通过以下格式化 URL:

http://{host}:{port}/{context_root}/{resource}/application.wadl

但现在需要知道,这将如何生成,我正在使用 jersy 2.0 API 而不是 Weblogic Server 用于 REST 实现。

如果它是自动生成的,那么需要什么环境和API?

一些 wiki 或文档 URL 将不胜感激。

我认为您正在从 Jersey 文档中寻找这个,它似乎负责 WADL 生成。

17.2. Configuration

WADL generation is enabled in Jersey by default. This means that OPTIONS methods are added by default to each resource and an auto-generated /application.wadl resource is deployed too. To override this default behavior and disable WADL generation in Jersey, setup the configuration property in your application:

jersey.config.server.wadl.disableWadl=true

This property can be setup in a web.xml if the Jersey application is deployed in the servlet with web.xml or the property can be returned from the Application. getProperties(). See Deployment chapter for more information on setting the application configuration properties in various deployments.

WADL support in Jersey is implemented via ModelProcessor extension. This implementation enhances the application resource model by adding the WADL providing resources. WADL ModelProcessor priority value is high (i.e. the priority is low) as it should be executed as one of the last model processors. Therefore, any ModelProcessor executed before will not see WADL extensions in the resource model. WADL handling resource model extensions (resources and OPTIONS resource methods) are not added to the application resource model if there is already a matching resource or a resource method detected in the model. In other words, if you define for example your own OPTIONS method that would produce "application.wadl" response content, this method will not be overridden by WADL model processor. See Resource builder chapter for more information on ModelProcessor extension mechanism.

https://jersey.java.net/documentation/latest/wadl.html#d0e13189

您也可以查看 Weblogic 文档: http://docs.oracle.com/cd/E24329_01/web.1211/e24983/develop.htm#RESTF240