How to generate WADL file using Jersey 1.7(如何使用 Jersey 1.7 生成 WADL 文件)
问题描述
我创建了一个 hello world REST 服务,现在我想生成 WADL 文件.
I created a hello world REST service and now I d like to generate the WADL file.
我环顾四周,发现我可以通过调用来做到这一点:
I looked around and saw that I can do so by calling :
http://localhost:8090/application.wadl
但是我没有得到任何东西.我正在使用带有 Eclipse Indigo 的 Jersey 1.7 并在 Apache 7 上运行
However I dont get anything in my case. I am using Jersey 1.7 with Eclipse Indigo and running on Apache 7
我也试过打电话:
http://localhost:8090/<myapplication_name>.wadl 但仍然没有结果.
Jersey 1.7 是否支持此功能?如果是,我做错了什么?
Is this feature supported by Jersey 1.7? If yes what do i do wrong?
web.xml 文件如下所示:
The web.xml file looks like this:
谢谢
推荐答案
你的应用在 Apache 中的名称是什么,即context"?假设名称是restApp".试试这个:
What is the name of your app in Apache, i.e., "context"? Assume the name is "restApp". Try this:
http://localhost:8090/restApp/application.wadl
或者,如果你的 servlet 映射是:
Or, if you servlet mapping is:
<servlet-mapping>
<servlet-name>RESTService</servlet-name>
<url-pattern>/company/rest/*</url-pattern>
</servlet-mapping>
..它会是:
http://localhost:8090/restApp/company/rest/application.wadl
这篇关于如何使用 Jersey 1.7 生成 WADL 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 Jersey 1.7 生成 WADL 文件
基础教程推荐
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
