users@jsr311.java.net

Re: JAXRS handlers

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Fri, 28 Mar 2008 16:53:38 -0000

Ok, no problems.

So here's a user question. Any references/links will be appreciated.

Suppose I have chosen a JAX-RS implementation to work with.
Lets say I want to provide few features on top of it.
Here's a very simple example. I'd like to be able to debug my services and check the formats of the representations without messing with Accept header. I'd like to issue this query from my browser :

/foo?_type=json

Note, I don't want the application code to worry about supporting this query, it can but it doesn't have to.
Can you advise me please on how can I solve the problem by using a Spring integration capabilities ?

Is it off-topic for a given list ?


Cheers, Sergey



> -1.
>
> I don't think we should be creating a new component model. Integration
> with Web Beans, EJB, and/or Spring would be good enough.
>
> Sergey Beryozkin wrote:
>> Hi
>>
>> Is there any chance for JAX-RS to introduce a notion of handlers, such
>> that they can be invoked before/after the
>> actual resource class has been invoked upon ? There's a number of
>> container-specific ways to handle it, for ex, servlet filters can be
>> used in a Servlet-aware container, but it would be handy to have a
>> notion of handlers in JAX-RS as well.
>>
>> For ex.
>>
>> interface ResourceHandler {
>>
>> Response handle(UriInfo uriInfo, Class resourceClass);
>> }
>>
>> For inbound handlers, if Response is null the the invocation continues
>> otherwise this Response is what needs to be returned
>> Similar (if not the same) interface can be created for out-bound handlers.
>>
>> Such handlers can be used to extend the base JAX-RS implementation, as
>> far as handling of various queries is concerned.
>> For ex.
>> GET /foo?$coolFeatureQuery
>>
>> will result in either a per or post handler handling the
>> request/response somehow.
>>
>> Does it make sense ?
>>
>> Thanks, Sergey
>>
>>
>>
>>
>> ----------------------------
>> IONA Technologies PLC (registered in Ireland)
>> Registered Number: 171387
>> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland