users@jersey.java.net

[Jersey] Forward (or include) from one resource to another (no JSP)

From: ookigaijin <maciek_r_at_ymail.com>
Date: Fri, 27 Nov 2009 04:10:27 -0800 (PST)

version: 1.1.3-ea

Uff, I'm struggling with that one. Basically, there is a resource A with say
@Path("resourceA") and all I want to do is to forward/include (either will
do for me) to the resourceB @Path("resourceB"). All I need to get hold of is
the output stream of the response in the resourceA after the dispatch.

in pure servlet way it's an old trivial
getRequestDispatcher("/path/to/resource/").include(req,res) or forward().

Using @Context HttpServletRequest and getting dispatcher and forwarding
works fine to a point. The resource B gets executed allrite, but the forward
call never returns, falling into some dodgy internal tangle I suppose that
eventually runs JVM out of heap (not even stack).
WebApplication.handleRequest gets executed.
Viewable, although close, doesn't seem to do the trick.

Anyone ever tried that?

Cheers,
mac
-- 
View this message in context: http://n2.nabble.com/Forward-or-include-from-one-resource-to-another-no-JSP-tp4075435p4075435.html
Sent from the Jersey mailing list archive at Nabble.com.