You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jeff Madynski <JM...@Netcentives.com> on 2000/02/01 18:04:19 UTC

Problem processing a Post with getRequestDispatcher.include()

Has anyone had this problem with a post request??

I am processing a post request in a servlet that does this a couple of
times: getRequestDispatcher(url).include(req, res)

The includes are not working because I call HttpUtils.parsePostData(x,x) in
doPost in the main servlet,
then when the included servlet goes to read the post data, which has already
been read, and then
it blows the following exception.

Is there any workaround for this in my code?
It works in JRUN.

java.lang.IllegalArgumentException: Short Read
	at javax.servlet.http.HttpUtils.parsePostData(HttpUtils.java:238)
	at
org.apache.tomcat.util.RequestUtil.readFormData(RequestUtil.java:98)
	at
org.apache.tomcat.core.RequestImpl.handleParameters(RequestImpl.java,
Compiled Code)
	at
org.apache.tomcat.core.RequestImpl.getParametersCopy(RequestImpl.java,
Compiled Code)
	at
org.apache.tomcat.core.RequestDispatcherImpl.include(RequestDispatcherImpl.j
ava, Compiled Code)
	at xxx.RequestDispatcherInclude(CServletData.java, Compiled Code)
	at xxx.BaseServlet.HandleRequest(CBaseServlet.java:304)
	at xxx.CBaseServlet.doPost(CBaseServlet.java:181)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
	at
org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java,
Compiled Code)
	at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
	at
org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:240)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
	at
org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java,
Compiled Code)
	at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
	at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:347)
	at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:146)
	at
org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:305)
	at java.lang.Thread.run(Thread.java:479)