> -----Original Message-----
> From: Benson Margulies [mailto:bimargul...@gmail.com]
> Sent: Wednesday, November 18, 2009 10:42 AM
> To: users@cxf.apache.org
> Cc: cxf-u...@incubator.apache.org
> Subject: Re: JAX-RS and cache-control
> 
> I really don't want to do this at the servlet level, I want it to work
> in
> embedded jetty.
> 
> Can you point me at an example of registering a ResponseHandler for my
> entire service?

Your first statement makes me think you think the servlet level is too "low" in 
the scope for your comfort, and you want it controlled at a higher scope, at 
the container level itself.  Your next statement refers to the ResponseHandler 
in CXF, which is at an even lower scope than the servlet level.

If you want it controlled at the container level, then you should examine the 
configuration details of Jetty.  It's entirely possible this can be done.

I wouldn't think it would make sense to do this at the CXF level.  Your 
requirement has nothing to do with what CXF is doing, so why use CXF to do it?

> On Wed, Nov 18, 2009 at 12:25 PM, Sergey Beryozkin
> <sbery...@progress.com>wrote:
> 
> > Sure, it should actually work for JAXWS services too...Or doing the
> same in
> > the CXF custom out interceptor (MARSHAL phase for ex)
> > That said, few more options are available at the (CXF) JAX-RS level :
> > - register a custom ResponseHandler filer and override the JAXRS
> Response
> > by adding a Cache-Control header to the original Response, using a
> JAXRS
> > CacheControl utility
> > - return JAXRS Response directly from all your methods and set that
> header
> > there, but it might be more intrusive
> >
> > Sergey
> >
> >
> > ----- Original Message ----- From: "KARR, DAVID (ATTCINW)"
> <dk0...@att.com
> > >
> > To: <users@cxf.apache.org>; <cxf-u...@incubator.apache.org>
> > Sent: Wednesday, November 18, 2009 5:17 PM
> > Subject: RE: JAX-RS and cache-control
> >
> >
> >
> >
> >>  -----Original Message-----
> >>> From: Benson Margulies [mailto:bimargul...@gmail.com]
> >>> Sent: Wednesday, November 18, 2009 9:10 AM
> >>> To: cxf-u...@incubator.apache.org
> >>> Subject: JAX-RS and cache-control
> >>>
> >>> Can someone give me a recipe to add cache control headers to ALL
> >>> responses
> >>> from my JAX-RS service?
> >>>
> >>
> >> You should be able to implement a servlet filter that adds response
> >> headers for cache control.  In fact, several people on the internet
> have
> >> done exactly that.  Here's an example:
> >> <
> >> http://www.digitalsanctuary.com/tech-blog/java/jboss/setting-cache-
> headers-from-jboss.html
> >> >.
> >>
> >>
> >

Reply via email to