tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Rozhdestvensky <christ...@inbox.ru>
Subject JAX-RS @Context is null when @ApplicationPath used
Date Tue, 16 Aug 2016 09:16:30 GMT
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.

Mime
View raw message