2011-02-18 59 views
4

的如下所述:http://wikis.sun.com/display/Jersey/WADL帮助新泽西自动生成WADL

我在Tomcat的6使用1.4泽西

我曾尝试一切可能的URI以“/application.wadl”和所有我得到的是404(不可用)。我显然不理解某些东西,但是我读到的每一个博客都让它听起来像是“开箱即用”的功能。我正在使用Tomcat 6 ..应该如此吗?

我能够使用上使用WadlResource对象这里帕维尔的例子,但似乎我不应该需要做的:http://markmail.org/message/lbeaw5vyr4qergdd#query:+page:1+mid:fo4dt7tbd6rb3gvi+state:results

感谢。

+0

你找到任何解决这个<的url-pattern >?我在注释中遇到同样的问题,它在部署到码头时工作得很好,但它不在tomcat中。 – 2011-06-06 13:52:43

+1

我想我忘了在URL中添加Web应用程序的名称。例如,如果Web上下文名称(在$ TOMCAT_HOME/webapps中的项目目录名称)是“foo”,那么我必须使用http:// localhost:8080/foo/servletMappingPattern – ChrisO 2011-06-08 20:09:20

回答

4

我认为ChrisO最有可能在你的WADL将可在http://localhost答案:/application.wadl

0

你需要指定显示名称和URL模式{端口}/{} warname前application.wadl

3

的sevlet映射(如果有的话)我有同样的问题,并且发现了默认application.wadl仅在应用程序的根

我的conf包括几个URL时配置的工作如下图案

<filter-mapping> 
    <filter-name>jersey-spring</filter-name> 
    <url-pattern>/admin/rest/*</url-pattern> 
    </filter-mapping> 

我不得不添加此,使其工作:

<filter-mapping> 
     <filter-name>jersey-spring</filter-name> 
     <url-pattern>/application.wadl</url-pattern> 
    </filter-mapping> 

希望它可以帮助

2

如果使用新泽西州,在WADL会当你的后缀application.wadl被自动给出你的网址。

这里所有的/REST/对于< Servlet映射>

http: // yourmacine:8080/RESTfulExample/rest/application.wadl