Keep in mind that in Jersey a resource is just a POJO/bean that just happens
to have methods annotated with @Path.
It very well may be possible, but I haven't tried yet (being new to Jersey) to
have a class with both JAXB and Jersey annotations, such that the data model
and resource classes are the same. If that works out well I would think then
that the resulting REST service would just be a huge XML file where you can
select a subset of it via URLs.
You would need some kind of root resource that would be used to spawn
everything, I think. And it might not work out because the data model beans
would get too complex, or maybe you want to expose only part of the
information to the web, or maybe it would hurt your ability to load data
incrementally/lazily (i.e. if you can't hold everything at once).
Jason
On 7/9/2010 12:01 PM, Basmajian, Raffi wrote:
> Hi Jason,
>
> Thanks for the quick reply.
>
> I also felt that adding getCustomerIncident(cid,iid) in CustomerResource
> was putting too much in that one class.
>
> It feels more natural placing the routes in the classes relative to the
> resources they are serving.
>
> I'll give it a shot with the CustomersResource class.