Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 48846 invoked from network); 5 Sep 2006 10:15:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Sep 2006 10:15:27 -0000 Received: (qmail 271 invoked by uid 500); 5 Sep 2006 10:15:15 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 99766 invoked by uid 500); 5 Sep 2006 10:15:14 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 99754 invoked by uid 99); 5 Sep 2006 10:15:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Sep 2006 03:15:14 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [82.70.116.177] (HELO mail.melandra.com) (82.70.116.177) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Sep 2006 03:15:13 -0700 Content-Class: urn:content-classes:message Subject: RE: How send svg content to browser as response MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Tue, 5 Sep 2006 11:14:48 +0100 Message-ID: X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How send svg content to browser as response thread-index: AcbQ0hp/WKeBXJbkST+VvxS609FDLAAAW1mQ From: "Peter Crowther" To: "Tomcat Users List" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N > From: prad [mailto:prad4svg@yahoo.co.in]=20 > Am processing some svg files on server side and after=20 > processing i need to > send the svg as response...I set the mime type as "image/svg+xml" > and tried the below code >=20 > public void doGet(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException{ >=20 > response.setContentType("text/html"); Erm? I thought you said you were setting the type to SVG? > PrintWriter out =3D response.getWriter(); >=20 > out.println(""); > out.println(" "); > out.println(" SimpleServlet"); > out.println(" "); > out.println(" "); > out.println(" Hello, World"); > out.println(" "); > out.println(""); > } >=20 > when i invoke this servlet .....it's showing download dialog=20 > box and if > press ok .....servletName.svg file gets downloads > Why its not directly displaying the contents in the=20 > browser...Any help plz.. Firstly I'd send some valid SVG, not HTML, as the payload. Secondly does your browser have SVG handling, either natively or via a plug-in? Thirdly have you used any tool such as ieHttpHeaders to check the content-type? Fourthly, are you using Internet Explorer? It has a nasty habit of using the URL's extension to guess the type of the downloaded content rather than replying on the MIME type. If you're serving the content with a .svg extension and don't have a plug-in that accepts the content, IE may well offer to save the file rather than display HTML. - Peter --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org