Hi all,
I'm using a RequestDispatcher to forward a request to another servlet on the same server. It took a while
to get it running, and now I'm stuck on this line of code:
public void service(HttpServletRequest request, HttpServletResponse response) {
...
ServletInputStream in = request.getInputStream();
...
}
The error looks like follows:
java.lang.IllegalStateException: Reader already obtained for this request.
at org.apache.tomcat.facade.HttpServletRequestFacade.getInputStream(HttpServletRequestFacade.java:190)
....
I've tried to find info on this topic all day, but to no avail. I'm not sure how to get around this problem.
Do I need to reset() the request and mark() it again? If so, where do I do it, in the calling service, or in the
called service? Is there perhaps another way of getting the Content of the request without an InputStream
or Reader? Do I need to set something up on tomcat itself?
Also,
request.getReader().ready
returns false.
B.T.W. I'm running tomcat 3.2.4 on a Windows box.