users@jersey.java.net

Re: [Jersey] documentation of service

From: James Strachan <james.strachan_at_gmail.com>
Date: Wed, 1 Apr 2009 09:41:03 +0100

2009/4/1 tarjei <tarjei_at_nu.no>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
> Felipe Gaścho wrote:
>> almost worked: :http://fgaucho.dyndns.org:8080/footprint-service/application.wadl?format=html
>>
>> On Tue, Mar 31, 2009 at 8:37 PM, Arul Dhesiaseelan <arul_at_fluxcorp.com> wrote:
>>> You could try using xml-maven-plugin for transformation, if you are using
>>> maven.
>>>
>>> Or, you could also look at this blog entry[1] which uses a servlet filter to
>>> do this.
>
> Way cool :)
>
> Would it be possible to for Jersey to include a basic resource that did
> this, so that to get generated documentation for a jersey service all
> you had to do was:
>
> @Path("/")
> @Service("root")
> class MyRootResource {
> ...
>        @Path("/doc")
>        Resource getDocs() {
>            return new JerseyDocumentationResource();
>        }
> }

See this thread for background...
http://n2.nabble.com/-PATCH--to-allow-the-API-of-RESTful-services-to-be-rendered-using--hierarchial-Implicit-Views-td2353447.html#a2353485

Its now pretty easy to do this yourself.

FWIW I've a little OSS project that will be public by the end of the
month which can add support for a nice HTML hierarchical view of the
WADL documentation (i.e. a couple of resource beans, some JSP files
and a couple of JSP custom tags) that its very easy to just add as a
dependency in your pom.xml to get this feature. Or you can just cut n
paste the code if you're not using maven :).

I'm using this on a number of projects now - but wanted to minimise
cut and paste so I've popped the code into a little OSS project. I'll
ping the list as soon as the little site is up...

-- 
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/