Hi Brad
If you can afford returning a Response in a signature then that would be the
easiest way to have
custom response headers set.
I'm wondering does @ProduceMime("contextTypeValue") has an effect ? It should, the only problem is that on the trunk the parameters
are ignored (to be fixed shortly) that is, if you do something like
@ProduceMime("application/atom+xml;type=feed")
then ';type=feed' will be ignored.
Finally you can have a field
@Resource HttpServletResponse response;
@Context-annotatted injection of these types will be supported shorty too, but in meantime you can try this option. The only problem
is that it's not thread-safe (will be fixed too), unless you're using a per-request resource creation. So, once the big update is
in, you can do :
YourXmlObject doIt(@Context HttpServletResponse response)
which would be thread-safe even for singletons. Thread-local proxies for context fields will also be supported, not sure though I'll
get a chance to fox it during the next week or so...
Cheers, Sergey
----- Original Message -----
From: "Brad" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, June 12, 2008 4:10 PM
Subject: getting javax.servlet.http objects in JAX-RS
Hi all,
could anyone tell me how to get the standard HTTP objects
HttpServletRequest and HttpServletResponset in a JAX-RS service
method?
I'm particularly interested in being able to set the content-type
header on my response.
Thanks,
Brad.
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland