2012-03-14 10 views

risposta

10

RESTEasy può iniettare HttpResponse che consente di impostare i parametri di intestazione.

@Path("/") 
public class MyService { 
    @Context org.jboss.resteasy.spi.HttpResponse response; 

    @GET @Path("/") public void setHeader(){ 
     response.getOutputHeaders().putSingle("X-Some-Header", "value"); 
    } 
}