如何使用Jersey 1.7生成WADL文件

我创建了一个hello world REST服务,现在我想生成WADL文件。

我环顾四周,看到我可以通过致电:

http://localhost:8090/application.wadl 

但是,在我的情况下,我没有得到任何东西。 我正在使用带有Eclipse Indigo的Jersey 1.7并在Apache 7上运行

我也试着打电话:

http://localhost:8090/.wadl但仍然没有结果。

Jersey 1.7是否支持此function? 如果是的话,我做错了什么?

web.xml文件如下所示:

在此处输入图像描述

谢谢

您的应用程序在Apache中的名称是什么,即“上下文”? 假设名称是“restApp”。 尝试这个:

 http://localhost:8090/restApp/application.wadl 

或者,如果servlet映射是:

  RESTService /company/rest/*  

..这将是:

 http://localhost:8090/restApp/company/rest/application.wadl 

它通常在这种模式下:

 http://:///application.wadl 

假设您的项目部署desc(web.xml)如下所示:

   Restful Web Application  jersey-helloworld-serlvet  com.sun.jersey.spi.container.servlet.ServletContainer   com.sun.jersey.config.property.packages com.example.rest.jersey  1   jersey-helloworld-serlvet /rest/*   

然后url将是这样的: http://localhost:8080/JAXRS-HelloWorld/rest/application.wadl

就我而言:

 JAXRS_HelloWorld is project name rest is url pattern