hmmmm... I'm not sure that out.println() is the best way for downloading files (sending files to the client), but i dont know enough about file downloading and servlets to be able to help. I know there is another approach (or several appraches for that matter including setting something in the HTML header to tell the browser to request a file) but I dont know enough about it. Since you call out.println(..) your response is commited and you cant subsequently call response.sendRedirect(..). I think this is more a design issue of your approach and without knowing more about what it is you are trying to do I'm afraid i cant help.
-----Original Message----- From: Shanta B [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 12:42 PM To: Tomcat Users List Subject: RE: servlet response.sendRedirect() illegal state exception Hi Tim We have one download servlet ..which is called from different servlets....in download servlet we used out.println() for downloading csv files...so each servlets calls one servlet ..this servlets redirects request to download servlet... Ex: FirtServlet calls CentralServlet CentralServlet Calls Download servlet SecondServlet callls CentralServlet CentralServlet Calls Download servlet so we have used rsp.sendRedirect() in CentralServlet ...In download servlet we used both following statements PrintWriter out=new PrintWriter(rsp.getOutputStream()) out.println(messagetodownload); out.flush(); sugget me whats the alternative ..... -----Original Message----- From: Tim Davidson [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 12:17 PM To: Tomcat Users List Subject: RE: servlet response.sendRedirect() illegal state exception It means a response has already been committed (i.e. you have already committed to sending HTML from that servlet). Somewhere it your code you are using the printWriter or response.sendRedirect or you are already forwarding to another servlet. You should avoid having more than one response.sendRedirect/forward or controling it with if statements. You cant do this: out.print("<HTML>"); response.sendRedirect(..); this would cause the llegal state exception. -----Original Message----- From: Shanta B [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 10:49 AM To: Tomcat Users List Subject: servlet response.sendRedirect() illegal state exception Hi In my servlet response.sendRedirect i am getting illegal state exception ...could pl tell me how to avoid this...whats does it mean... Thanks Shanta.B -----Original Message----- From: Hartmut Bernecker [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 9:40 AM To: [EMAIL PROTECTED] Subject: ISAPI integration: Tomcat 4.1.24, IIS 5 with HTTP PUT request Hello, I am faced to the problem that the Tomcat-IIS integration doesn't work when doing some HTTP PUT Request! HTTP GET and HTTP POST requests works well. Also HTTP PUT Request works well when running Tomcat standalone (w/o IIS, Port 8080). You have some Idea? I do not. Hartmut Bernecker THE REQUEST: PUT /asim/savexml?hierid=12 HTTP/1.1 Content-Type: text/xml User-Agent: XMLSpyDocEditPlugIn Host: ep158:9999 Content-Length: 943 Connection: Keep-Alive Cache-Control: no-cache Cookie: JSESSIONID=9A85D9E5B0796C0C309DBC3EB207235F <?xml version="1.0" encoding="UTF-8"?> <af-longtext> [... some xml data ...] </af-longtext> THE RESPONSE: HTTP/1.1 500 Server Error Server: Microsoft-IIS/5.0 Date: Wed, 25 Jun 2003 14:06:05 GMT Connection: close Content-Type: text/html Content-Length: 79 <html><head><title>Error</title></head><body>Falscher Parameter. </body></html> THE ISAPI-LOG: [Wed Jun 25 16:02:16 2003] [jk_ajp_common.c (1318)]: Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. Failed errno = 61 [Wed Jun 25 16:02:16 2003] [jk_isapi_plugin.c (928)]: HttpExtensionProc error, service() failed WORKERS PROPERTIES: worker.list=testWorker worker.testWorker.port=8009 worker.testWorker.host=localhost worker.testWorker.type=ajp13 URIWORKERMAP PROPERTIES: /myApp/*=testWorker --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
