tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: error-page and POST vs GET
Date Fri, 02 May 2003 15:50:30 GMT
Amazingly enough, I can reproduce what you're seeing.  I'm attaching a
.war file with a clean stand-alone webapp that shows this effect.  I
thought using the examples context only complicated things, so I took
that out.  Same for the invoker servlet.  Added a simple test HTML file.

So if someone else cares to comment, that'd be great ;)

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: Mohun Biswas []
>Sent: Friday, May 02, 2003 10:41 AM
>Subject: Re: error-page and POST vs GET
>>What happens if you copy the code from doGet into the doPost method,
>>rather than call doGet from doPost?
>Tried it, it changes nothing.
>I've been able to reproduce this with a vanilla Tomcat 4.1.24 setup by
>adding a couple of tiny servlets plus the <error-code> mapping to the
>/examples context. I'm attaching these and I'd appreciate it if someone
>would try to reproduce. I'm beginning to think it's an actual bug. How
>First, go to .../examples/WEB-INF/web.xml and add the following just
><servlet-mapping> and just above <taglib> (the modified web.xml is also
>     <error-page>
>         <exception-type>
>             javax.servlet.ServletException
>         </exception-type>
>         <location>
>             /servlet/ErrorHandlerServlet
>         </location>
>     </error-page>
>Then just stick the two servlets into .../examples/WEB-INF/classes. One
>called LabServlet and it simply throws a ServletException from either a
>or a POST. The other is ErrorHandlerServlet and it's supposed to
>the exception. Which it does as long as the request is a GET. What I do
>comment out the "throw" statements just to ensure that the servlet is
>called correctly, then turn on the throw and see POST do the wrong
>How you generate the request is immaterial, of course, but for the
>I'm using the "curl" command-line tool on Unix. I create the GET
>         curl localhost:8080/examples/servlet/LabServlet
>and get the correct response
>         In the error handler
>I then make a POST by giving it some data:
>         curl -d foo localhost:8080/examples/servlet/LabServlet
>And get the standard HTML-ified stack trace just as if there was no
><error-page>. The -v flag can be passed to curl to verify that the
>are GET and POST.
>So: I've seen nothing in the spec that differentiates beween
>of GET vs POST but an actual difference is easily reproduceable in the
>latest production release. Is it a bug? Or is there some documentation

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

View raw message