Hi Larry,

 

            I discovered something interesting about Tomcat while playing
with Opera svg/svgz. This may be of interest to others as well.

 

Tomcat sets mime types in its web.xml. 

 

1. If you have an older Tomcat web.xml it may contain some bogus svg mime
types:

    <mime-mapping>

        <extension>svg</extension>

        <mime-type>image/svg </mime-type>

    </mime-mapping>  

    <mime-mapping>

        <extension>svgz</extension>

        <mime-type>image/svg </mime-type>

    </mime-mapping>

 

These need to be deleted for FF and Opera. This did not cause a problem in
ASV. Evidently Tomcat finds the last mime-type for a given extension key and
uses that for the header, which causes further problems seen below.

 

2. The default Tomcat download for windows lists svg mime types in this
order:

    <mime-mapping>

        <extension>svg</extension>

        <mime-type>image/svg+xml</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>svgz</extension>

        <mime-type>image/svg+xml</mime-type>

    </mime-mapping>

 

Tomcat assigns the last listed mime-type for a given ext, which would seem
to be fine since ext 'svgz' is not the same as extension 'svg'. However, if
the 'svg' mime extension is listed first it seems to be overridden by the
'svgz' extension. In other words no matter if you have 'svg' files or 'svgz'
files Tomcat will treat it as 'svgz'. It sounds like an (ext.indexOf
("svg")!=-1) type of problem with Tomcat. If the 'svgz' mime type is deleted
then Opera gets the correct mimetype 'svg' from Tomcat and it will recognize
svg files. Vice versa is also true. Leaving in 'svgz' and taking out 'svg'
allows svgz files to be recognized properly.

 

3. The way I finally got both working was to reverse the mime type order
thus:

    <mime-mapping>

        <extension>svgz</extension>

        <mime-type>image/svg+xml</mime-type>

    </mime-mapping>  

    <mime-mapping>

        <extension>svg</extension>

        <mime-type>image/svg+xml</mime-type>

    </mime-mapping>

This solved the problem for me and I can display both .svg and .svgz with no
problem in Opera.

 

4. Another approach was the Tomcat "compression" setting I referenced in an
earlier post. This has the nice feature of letting you forget about pre
compression into svgz. All svg will be automatically compressed after
whatever size threshold you set. However, there may be some minimal time
savings by using pre-compressed svgz files and keeping separate svg and svgz
mime-types.

 

Maybe this is old hat for Opera svg people but I had not run into this until
I started working with Opera.

 

Also important to note while experimenting "clear" the cache!

 

Randy



[Non-text portions of this message have been removed]



-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to