Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 47273 invoked from network); 22 Apr 2003 14:11:49 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 22 Apr 2003 14:11:49 -0000 Received: (qmail 16167 invoked by uid 97); 22 Apr 2003 14:13:45 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 16160 invoked from network); 22 Apr 2003 14:13:44 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 22 Apr 2003 14:13:44 -0000 Received: (qmail 45815 invoked by uid 500); 22 Apr 2003 14:11:29 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 45800 invoked from network); 22 Apr 2003 14:11:29 -0000 Received: from thoth.sbs.de (192.35.17.2) by daedalus.apache.org with SMTP; 22 Apr 2003 14:11:29 -0000 Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.11.7/8.11.7) with ESMTP id h3MEBTM04713 for ; Tue, 22 Apr 2003 16:11:29 +0200 (MEST) Received: from delg001a.sisl.co.in (delg001a.sisl.co.in [132.186.198.2]) by mail2.siemens.de (8.11.7/8.11.7) with ESMTP id h3MEBSZ10635 for ; Tue, 22 Apr 2003 16:11:28 +0200 (MEST) Received: by delg001a with Internet Mail Service (5.5.2653.19) id ; Tue, 22 Apr 2003 19:41:34 +0530 Message-ID: From: Shanta B To: Tomcat Users List Subject: RE: send RedirectProblem Date: Tue, 22 Apr 2003 19:41:33 +0530 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Hi I am facing some pecular problem at my client side.I have a servlet which is making redirecting to other servlet(named download servlet).This redirect occurs when you are downloading any file from server . This is the sample servlet call to download servlet.This code is working at ourside,but it is not working at our client.We are using servlet2.3 and tomcat4.1.18 servlet container. pl find my download servlet and otherservlet which calls download servlet import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import sun.misc.BASE64Decoder; public class DownloadServlet extends MsServlet { public String getServletInfo(){ return "This servlet changes the message content type and send it to the client."; } public void doPost(HttpServletRequest req, HttpServletResponse rsp) throws IOException { if (PrimitiveWml.checkAndPanicWmlClient(req, rsp)) return; SieMsSession session = SieMsSession.getOrCreateHtmlSession(req.getSession().getId()); String contentType = req.getParameter("contentType"); String fileName = req.getParameter("fileName"); setResponseHeader(rsp, contentType, fileName); printOutput(session, req, rsp); } public void setResponseHeader(HttpServletResponse rsp, String contentType, String fileName) { if (fileName == null || fileName.equals("")) { fileName = "document.txt"; } if (contentType == null || contentType.equals("")) { rsp.setContentType("text/html; charset=iso-8859-1"); } rsp.setHeader("Content-disposition", "attachment; filename=\"" + fileName + "\""); rsp.setContentType(contentType); } private void printOutput(SieMsSession s, HttpServletRequest req, HttpServletResponse rsp) { try { PrintWriter out =rsp.getWriter(); String messageToDownload = (String)s.at("toDownload"); if (messageToDownload != null) { out.print(messageToDownload); } else { out.print("\r\n"); } out.flush(); } catch (Exception e) { e.printStackTrace(); } } } Call to DownLoadServlet ------------------------ try { String contentType="application/vnd.ms-excel"; s.atPut("toDownload", messageToDownload); String shref = s.attachSessidToUrl("Download?contentType=" + contentType+"&fileName="+fileName); rsp.setHeader("asdasd", "asdasdasdasdasdasd"); rsp.sendRedirect(shref); s.logDebug(getClass(),"...redirected"); } catch (Exception e) { rsp.setContentType("text/html; charset=iso-8859-1"); showError(e.getMessage()); } -----Original Message----- From: Shanta B Sent: Tuesday, April 22, 2003 2:55 PM To: 'Tomcat Users List' Subject: RE: send RedirectProblem Hi I am not getting displayed the page where it shows that wouldlike to save or download file ...but in my logs i am seeing ...redirected as a message ... try { > s.atPut("toDownload", messageToDownload); > String shref = s.attachSessidToUrl("Download?contentType=" > + contentType+"&fileName="+fileName); > rsp.setHeader("asdasd", "asdasdasdasdasdasd"); > rsp.sendRedirect(shref); > s.logDebug(getClass(),"...redirected"); > } > catch (Exception e) > { > rsp.setContentType("text/html; charset=iso-8859-1"); > showError(e.getMessage()); > } -----Original Message----- From: Tim Funk [mailto:funkman@joedog.org] Sent: Tuesday, April 22, 2003 2:52 PM To: Tomcat Users List Subject: Re: send RedirectProblem 304 is not an error. More information about what a 304 is: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5 -Tim Shanta B wrote: > Hi > I am facing some pecular problem at my client side.I have a servlet > which is making redirecting to other servlet(named download > servlet).This redirect occurs when you are downloading any file from > server . > > This is the sample servlet call to download servlet.This code is > working at ourside,but it is not working at our client.We are getting > 304 error.We are using servlet2.3 and tomcat4.1.18 servlet container. > > > > try { > s.atPut("toDownload", messageToDownload); > String shref = s.attachSessidToUrl("Download?contentType=" > + contentType+"&fileName="+fileName); > rsp.setHeader("asdasd", "asdasdasdasdasdasd"); > rsp.sendRedirect(shref); > s.logDebug(getClass(),"...redirected"); > } > catch (Exception e) > { > rsp.setContentType("text/html; charset=iso-8859-1"); > showError(e.getMessage()); > } > > Its not throwing any error ,but still i can see (),"...redirected in > my catalina.out ...Can any body has some idea.I would like to know > that is there > any port conflicts at serverside. Client is using https communication..... > > Thanks in Advance > Shanta.B > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org