tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "d~l" <>
Subject RE: Tomcat 5.0.24 - JSP 2.0 SVG example (JSPX) - not opening rendered SVG object in IE 6
Date Thu, 11 Nov 2004 20:48:34 GMT
On 11 Nov 2004 at 11:05, Kumar Pandey kumar.pandey-at-transerainc. wrote:

> Were able to get this fixed?.
> I have similiar issue with IE 6 just displaying svg from a servlet with mime type image/svg+xml.
> Downloading and opening the svg file works fine.
> Thanks
> Kumar

Hello Kumar ..

I was beginning to think that I was in a minority with my SVG display problem in IE 6 ..

I received one "off list" suggestion (poster Lars not subscribed to the forum).

My thanks to Lars for his suggestion (but it was not suitable since it still requires a renaming
of file extension).



I also have this problem, and I found an ugly hack that works.
1.    add this to <tomcat-root>\conf\web.xml:
2.    restart the tomcat server.
3.    rename the <file>.jsp file to <file>.svg
Then http://<server:port>/<file>.svg will show nicely.
If you find a better solution, I will be happy to hear from you.

In fact, I have been configuring web.xml to try out similar ideas ..

Although IE browser will open a file with *.svg extension, I need to be able to 
open the JSPX generated SVG file with extension jspx .. without having to change the extension
to svg.

I concluded that this was an IE 6 browser problem .. since only IE 6 fails to open jspx generated
svg files.

I had, in fact, read the link you found .. on IE 6 ..

which reads .. 


So, in order to have all browsers accept your content properly 

1. make sure that all URLS end in .svg, including generated content (for InternetExplorerBrowser
 for example, using a dummy parameter as in "http://mysvg.jsp?ielikes=.svg"); 


2. set the MIME type on the server. 

also read here ..

"The main reason this is propagated is that IE (prior to v6) does not behave properly in
respect to SVG and MIME types. IE (prior to v6) treats SVG as SVG when, and only when, 
the url ends in .svg, it doesn't care about MIME. 


In fact, to generate and render SVG server side I have moved away from using jspx 
(because of the above unsolved problem) .. and I am now using 
php (yes, php running on Tomcat) to dynamically generate SVG server side.

here are two tutorials which I have followed with success .. 
delivering svg across all browsers ..including IE 6

and .. I have a php servlet running on Tomcat in CGI mode .. so I can now generate the SVG
server side using PHP.


But .. for my education .. I would still like to get the jspx.svg example to work in IE browsers.

In fact the SVG script is generated by this URL  .... http://localhost:8080/jsp-examples/jsp2/jspx/textRotate.jspx.html

So I guess using PHP I could use cURL function to scrape the screen and write the source as
a SVG file.

see here for an explanation of jspx.html usage ..

JSPX reference

These new rules make it possible to write a JSP Document as a regular XHTML file 
(with JSP elements for the dynamic content, of course), for instance, without having to 
place all content within a <jsp:root> element. 

You can even use .html as the extension for such files if you create a JSP property group

declaration like this:

in web.xml ..


for now .. PHP + SVG + Tomcat rules .. at least for my hybrid application!

of course PHP + SVG also works on Apache server (Apache server normally 
associated with PHP) but I need to integrate SVG graphics as components in a 
Tomcat hosted application.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message