> On Mon, 12 Nov 2001, Remy Maucherat wrote: > > | > I'm using this program called "loadsim" to get a simulation of a bunch of > | > users using my webapp. This is a java program utilizing the > | > java.net.HttpConnection to simulate the clients, built using large parts > | > of a apache loadsimulation system, right? > > Make that "java.net.HttpURLConnection" (as the client). > > | > Why is that? Why do I have to get the outputstream, and then just close it > | > to get the sendRedirect away? Why isn't the stream closed on exit of the > | > doGet/Post method? Or whatever? > | > | The default servlet doesn't use the output stream at all, and appears to > | behave correctly (verified using a telnet session). This looks like a > | problem with the HTTP client you're using. > > I also mentioned this in the first post (Mozilla behaves properly), but > why does it then work when I get and close the output stream as described?
I'm not 100% sure. I checked the result of a redirect sent by the default servlet with a telnet session, and the result was valid. If you open and close the stream in the servlet, I think you'll end up sending a zero length document (with an empty response body), while in the first case, a chunked error report will be sent (which is allowed on a 302 status). > Here's the code from "loadsim" that does the sampling, just if you don't > have much other to do today! (It's not that long, actually).. Remy -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
