Wednesday, November 23, 2011

RequestDispatcher dispatcher Failling to forward

Hi there,

I'm new to JSP and GWT, so maybe I commited an obvious mistake ...

I working with 2 servlets, one is RemoteServiceServlet, and this other
one is HttpServlet.
I'm trying to forward from Request+data from RemoteServiceServlet to
the HttpServlet wih no luck.

I receive :
SEVERE: Exception while dispatching incoming RPC call
java.io.IOException: Stream closed

The code in RemoteServiceSevlet is (simplified)

public void myRPCFunction(String param) {
HttpServletRequest req = getThreadLocalRequest();
req.setAttribute("param", param);
RequestDispatcher dispatcher =
req.getRequestDispatcher("MyHttpServlet");
try {
dispatcher.forward(getThreadLocalRequest, getThreadLocalResponse);
} catch (ServletException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
And I get the error while calling dispatcher.forward.
If I do the forward on
getServletContext().getNamedDispatcher("MyHttpServlet").forward(...)
instead, everything works as expected, beside not having my param
sent. And I believe this is the normal behavior for
getNamedDispatcher.
Any idea ?

Cheers
Claire

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment