I try get ServletContext in my custom application scope which extends
javax.ws.rs.core.Application. But in any case ServletContext field is null:

@ApplicationPath("/")
public class CApplication extends Application {
    @Context
    private ServletContext context;
    ...
}

Such problem doesn't have place in GlassFish and when @Context used inside
service too:

@Path(value = "/test")
public class CService {
    ...
    @Context
    private ServletContext context;
    ...
    @POST
    @Path("/store")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Response store(InputStream inputStream) {
    ...
}

Can anyone help?



--
View this message in context: 
http://tomee-openejb.979440.n4.nabble.com/JAX-RS-Context-is-null-when-ApplicationPath-used-tp4679758.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to