Hi 

I'd like the base class of a resource class to store the injected
HttpHeaders property. The resource class is a singleton and I'm using spring
appl context to load the beans. I'm using following sample code where the
HttpHeaders is not getting injected

Base Class:  
=============
@Context
private HttpHeaders httpHeaders;

public abstract class BaseResource {

    public String getHeaderProperty(String key) {
       // retrieve string property value from httpHeaders;
    }


}


Resource Class
=============
@Path("/customer/{id}")
public TestResource extends BaseResource {

@POST
@Consumes(MediaType.APPLICATION_JSON)
@Path("/media")

  public Response postMedia() {

    // fetch http header property
     String str = getHeaderProperty("key");
  }
}

Does the base class need to be a Root resource (have a @Path injected) for
this to work?  Any help is appreciated.

Thanks
Chandru

--
View this message in context: 
http://cxf.547215.n5.nabble.com/How-to-set-the-HttpHeader-in-the-base-class-of-a-singleton-resource-tp5525703p5525703.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to