View RSS Feed

My Java Tips

Adding MIME types to JBOSS

Rate this Entry
by , 11-01-2011 at 05:51 PM (3429 Views)
Consider that you have an application deployed on JBOSS application server. You offer different files in your application that can be opened or downloaded. But someone complains that the web application shows code of the file imbedded in the web page instead of opening or downloading it. What problem can there be?


Actually you have to tell your JBOSS application server of the supported files. For this, you need to add an entry in web.xml. For instance:


<mime-mapping>
<extension>dtd</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>

<mime-mapping>
<extension>exe</extension>
<mime-type>application/exe </mime-type>
</mime-mapping>

Hope this helps.

Submit "Adding MIME types to JBOSS" to Facebook Submit "Adding MIME types to JBOSS" to Digg Submit "Adding MIME types to JBOSS" to del.icio.us Submit "Adding MIME types to JBOSS" to StumbleUpon Submit "Adding MIME types to JBOSS" to Google

Updated 11-01-2011 at 05:54 PM by Java Tip

Tags: None Add / Edit Tags
Categories
JBoss , XML

Comments