On Mar 4, 2009, at 2:54 PM, John Huang wrote:
>
> We have some services implemented using Jersey. And these services
> are running in the same app server as our existing web application.
> Is it possible to forward or include the resource from our existing
> web application using servlet dispatcher instead of using the Jersey
> client api?
>
You can forward by injecting the HttpServletRequest and using that in
your code as normal. Including is trickier since typically JAX-RS only
writes the response after the resource method returns. You could
conceivably call RequestDispatcher.include from a
MessageBodyWriter.writeTo but I don't know how well that would work
out in practice.
Marc.