java - Get HttpServletRequest in Jax Rs / Appfuse application? - Stack Overflow
Adding it to the method signature worked. I imagine it's because the request and response objects don't yet exist when the class is instantiated, but does when called by the brower.
@Path("/") @GET @Produces(MediaType.APPLICATION_JSON) List<Person> read( @Context HttpServletRequest httpServletRequest, @Context HttpServletResponse httpServletResponse) { }
Read full article from java - Get HttpServletRequest in Jax Rs / Appfuse application? - Stack Overflow
No comments:
Post a Comment