I want to generate a wadl file for my project which is using resteasy + Jboss 6.4 + Maven. There are many examples given for jersey but not for resteasy does anyone used it for resteasy
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Resteasy since 3.0.14.Final do support WADL generation. You need to add resteasy-wadl to your dependency manager (e.g. maven):
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-wadl</artifactId>
<version>3.0.19.Final</version>
</dependency>
then declare a new servlet endpoint in your web.xml for providing generated wadl file:
<servlet>
<servlet-name>WADL</servlet-name>
<servlet-class>org.jboss.resteasy.wadl.ResteasyWadlServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>WADL</servlet-name>
<url-pattern>/application.wadl</url-pattern>
</servlet-mapping>
Sources code:
https://github.com/resteasy/Resteasy/tree/master/resteasy-wadl
Implementation ticket:
https://issues.jboss.org/browse/RESTEASY-166
Examples from Resteasy:
https://github.com/resteasy/resteasy-examples/tree/master/wadl-example/src/main/java/org/jboss/resteasy/wadl/testing