如何使用 Jersey 1.7 生成 WADL 文件 [英] How to generate WADL file using Jersey 1.7

查看:27
本文介绍了如何使用 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 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆