You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Zeina Aoun <zn...@yahoo.com> on 2006/11/01 01:16:50 UTC

haaving trouble html in tomcat 5.5.20

I am having trouble with html in tomcat. I am using the Apache Tomcat 5.5.20 Server
 
The problem is hard to describe. I am trying to enable some video clip files to be downloaded by users, but unfortunatley instead of downloading it opens up the garbage text on the webpage, just like if u try to open a media file in notepad or wordpad. It does not allow to download the media files.
 
But when I try running the html page outside tomcat or in another server, it opens up perfectly.
 
 
I am using .rmvb and .wmv format clips.
 
 
I am using this type of basic coding.
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<html>
    <head>
        <title> download video</title>
    </head>
     
         
        <br><br><br>
         
        <a href="video1.rmvb">  Clip1 </a>
       <br><br>
        <a href="video2.wmv"> Clip2 </a>
    < div> 

</html>
 
 
Thank u


Re: haaving trouble html in tomcat 5.5.20

Posted by Edoardo Panfili <ed...@aspix.it>.
Edoardo Panfili ha scritto:
> Zeina Aoun ha scritto:
>> I am having trouble with html in tomcat. I am using the Apache Tomcat 
>> 5.5.20 Server
>>  
>> The problem is hard to describe. I am trying to enable some video clip 
>> files to be downloaded by users, but unfortunatley instead of 
>> downloading it opens up the garbage text on the webpage, just like if 
>> u try to open a media file in notepad or wordpad. It does not allow to 
>> download the media files.
>>  
>> But when I try running the html page outside tomcat or in another 
>> server, it opens up perfectly.
> 
> It seems that tomcat doesn't set up the proper mime type of your media 
> files, the error is not in the html page.
> 
> I think that you can take a look at $TOMCAT/conf/web.xml and set up the 
> proper mime type, in my web.xml there is no mapping for rmvb or wmv.
> 
> loocking in mime.types of my linux machine:
> for wmv the mime type is video/x-ms-wmv
> 

Is not difficult, try: find web.xml in the tomcat installation directory 
(I am using OS X, what OS are you using?).

add the follow lines after the other mime-mapping

     <mime-mapping>
         <extension>wmv</extension>
         <mime-type>video/x-ms-wmv</mime-type>
     </mime-mapping>
     <mime-mapping>
         <extension>rmvb</extension>
         <mime-type>application/vnd.rn-realmedia-vbr</mime-type>
     </mime-mapping>

I hope that this is the right mapping, the first comes from my 
linux-box, the second from internet search.


Edoardo

> 
> 
>>  
>>  
>> I am using .rmvb and .wmv format clips.
>>  
>>  
>> I am using this type of basic coding.
>>  
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd">
>> <html xmlns="http://www.w3.org/1999/xhtml">
>>
>> <html>
>>     <head>
>>         <title> download video</title>
>>     </head>
>>                       <br><br><br>
>>                  <a href="video1.rmvb">  Clip1 </a>
>>        <br><br>
>>         <a href="video2.wmv"> Clip2 </a>
>>     < div>
>> </html>
>>  
>>  
>> Thank u
>>
>>
> 
> 


-- 
edoardo@aspix.it
AIM: edoardopn
Jabber: edoardopa@talk.google.com
tel:075 9142766

---------------------------------------------------------------------
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


Re: haaving trouble html in tomcat 5.5.20

Posted by Edoardo Panfili <ed...@aspix.it>.
Zeina Aoun ha scritto:
> I am having trouble with html in tomcat. I am using the Apache Tomcat 5.5.20 Server
>  
> The problem is hard to describe. I am trying to enable some video clip files to be downloaded by users, but unfortunatley instead of downloading it opens up the garbage text on the webpage, just like if u try to open a media file in notepad or wordpad. It does not allow to download the media files.
>  
> But when I try running the html page outside tomcat or in another server, it opens up perfectly.

It seems that tomcat doesn't set up the proper mime type of your media 
files, the error is not in the html page.

I think that you can take a look at $TOMCAT/conf/web.xml and set up the 
proper mime type, in my web.xml there is no mapping for rmvb or wmv.

loocking in mime.types of my linux machine:
for wmv the mime type is video/x-ms-wmv

Edoardo


>  
>  
> I am using .rmvb and .wmv format clips.
>  
>  
> I am using this type of basic coding.
>  
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> 
> <html>
>     <head>
>         <title> download video</title>
>     </head>
>      
>          
>         <br><br><br>
>          
>         <a href="video1.rmvb">  Clip1 </a>
>        <br><br>
>         <a href="video2.wmv"> Clip2 </a>
>     < div> 
> 
> </html>
>  
>  
> Thank u
> 
> 


-- 
edoardo@aspix.it
AIM: edoardopn
Jabber: edoardopa@talk.google.com
tel:075 9142766

---------------------------------------------------------------------
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


Re: haaving trouble html in tomcat 5.5.20

Posted by Martin Gainty <mg...@hotmail.com>.
have you tried to apprise the response to setHeader so it may understand the specific wmv content-type e.g.
response.setHeader("Content-Type","video/x-ms-wmv");

M-
This e-mail communication and any attachments may contain confidential and privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its 
contents
----- Original Message ----- 
From: "Zeina Aoun" <zn...@yahoo.com>
To: <us...@tomcat.apache.org>
Sent: Tuesday, October 31, 2006 7:16 PM
Subject: haaving trouble html in tomcat 5.5.20


I am having trouble with html in tomcat. I am using the Apache Tomcat 5.5.20 Server
 
The problem is hard to describe. I am trying to enable some video clip files to be downloaded by users, but unfortunatley instead of downloading it opens up the garbage text on the webpage, just like if u try to open a media file in notepad or wordpad. It does not allow to download the media files.
 
But when I try running the html page outside tomcat or in another server, it opens up perfectly.
 
 
I am using .rmvb and .wmv format clips.
 
 
I am using this type of basic coding.
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<html>
    <head>
        <title> download video</title>
    </head>
     
         
        <br><br><br>
         
        <a href="video1.rmvb">  Clip1 </a>
       <br><br>
        <a href="video2.wmv"> Clip2 </a>
    < div> 

</html>
 
 
Thank u