cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Klaus Bertram <k.bert...@kbsm.de>
Subject Re: Cleanup forms/samples/resources
Date Mon, 29 Nov 2004 15:15:52 GMT
Antonio Gallardo wrote:
> <cita quiƩn="Jorg Heymans">
> 
>>
>>Jeremy Quinn wrote:
>>
>><snip/>
>>
>>>Yes, I was one of the people always doing that !!!
>>>I always assumed you needed to add the mime-type to the <map:read/> so
>>>needed specific pipelines for each type.
>>>
>>>Thanks for the tip !!!
>>
>>How does cocoon send the mimetype of a file then? Does it have a
>>mime.types somewhere internally like apache? Or does it rely on the
>>browser to interprete the binary stream correctly or guess it from the
>>file extension?
> 
> 
> Yep. From the file extension. Defined in the web.xml. For example in
> Tomcat See:
> 
> $TOMCAT_HOME/conf/web.xml
> 
> For the no-defined applications, we can also add new ones in the Cocoon
> web.xml file.
> 
> Search for mime in both files.
Hi all,

this bothered me yesterday and I make some test with pdf, doc, rtf, xls 
documents. The reader send doc and xls docs at text when no mime-type 
attribute is given at the sitemap. There is also no Content Header added 
without the mime-type attribute.

But the source says:
public String getMimeType() {
         Context ctx = ObjectModelHelper.getContext(objectModel);
         if (ctx != null) {
             final String mimeType = ctx.getMimeType(source);
             if (mimeType != null) {
                 return mimeType;
             }
         }

         return inputSource.getMimeType();
     }
so if I see it correct the header should always appended. or I'm wrong?

Klaus

Mime
View raw message