> The problem _I_ had with AvantGo is the following: Given this _very_
stupid
> but _very_ valid servlet:
>
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.io.*;
>
> public class Test extends HttpServlet {
>
>   public void doGet(HttpServletRequest req, HttpServletResponse res)
>   throws IOException, ServletException {
>     res.setStatus(302);
>     res.setContentLength(0);
>     res.setHeader("Location","http://www.vnunet.com/PDARedirected";);
>   }
> }
>
> Check out what the _hell_ does happen... (I'm doing it with keep alive so
> you'll get the extent of the damage):
>
> [pier@blossom] ~ $ telnet localhost 8080
> Trying 127.0.0.1...
> Connected to localhost.betaversion.org.
> Escape character is '^]'.
> GET /servlet/Test HTTP/1.1
> Host: localhost:8080
>
> HTTP/1.1 302 Moved Temporarily
> Content-Type: text/html
> Content-Length: 0
> Date: Fri, 10 May 2002 00:25:16 GMT
> Location: http://www.vnunet.com/PDARedirected
> Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
>
> <html><head><title>Apache Tomcat/4.0.3 - Error
> report</title><STYLE><!--H1{font-family : sans-serif,Arial,Tahoma;color :
> white;background-color : #0086b2;} BODY{font-family :
> sans-serif,Arial,Tahoma;color : black;background-color : white;} B{color :
> white;background-color : #0086b2;} HR{color : #0086b2;} --></STYLE>
> </head><body><h1>Apache Tomcat/4.0.3 - HTTP Status 302 - Moved
> Temporarily</h1><HR size="1" noshade><p><b>type</b> Status
> report</p><p><b>message</b> <u>Moved
> Temporarily</u></p><p><b>description</b> <u>The requested resource (Moved
> Temporarily) has moved temporarily to a new location.</u></p><HR size="1"
> noshade></body></html>GET /servlet/Test HTTP/1.1
> Host: localhost:8080
>
> HTTP/1.1 302 Moved Temporarily
> Content-Type: text/html
> Content-Length: 0
> Date: Fri, 10 May 2002 00:25:24 GMT
> Location: http://www.vnunet.com/PDARedirected
> Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
>
> <html><head><title>Apache Tomcat/4.0.3 - Error
> report</title><STYLE><!--H1{font-family : sans-serif,Arial,Tahoma;color :
> white;background-color : #0086b2;} BODY{font-family :
> sans-serif,Arial,Tahoma;color : black;background-color : white;} B{color :
> white;background-color : #0086b2;} HR{color : #0086b2;} --></STYLE>
> </head><body><h1>Apache Tomcat/4.0.3 - HTTP Status 302 - Moved
> Temporarily</h1><HR size="1" noshade><p><b>type</b> Status
> report</p><p><b>message</b> <u>Moved
> Temporarily</u></p><p><b>description</b> <u>The requested resource (Moved
> Temporarily) has moved temporarily to a new location.</u></p><HR size="1"
> noshade></body></html>^]
> telnet> close
> Connection closed.
> [pier@blossom] ~ $
>
> My servlet _says_ it's a 302, temporary redirect, my servlet _says_ the
> content length is 0, my servlet doesn't touch even barely the stupid
stream
> because it got nothing to do with the sucker, and then, I still get back
> some text, _AND_ the Content-Length saying that there MUST NOT BE...
>
> This _screws_ up all my requests... Allloooffftthhheemmmm... Keep alive is
> dropped, and mess mess mess on all PDAs...
>
> ARRRRGGGGHHHH I hate the ErrorReporterCrap...

Yes, it's horrible. Given the way the old HTTP/1.1 connector is written it's
very hard and very risky to fix :-(

Use Coyote instead for deperate situations ;-)
At least, one version which doesn't throw a NPE (I suppose it does help).

I tried the example you mentioned above and your "nasty" 302 AvantGo
servlet, and both work fine in 4.1.1 (and 4.1.0 probably).

Remy


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to