PDA

View Full Version : different types of document display


kamilski81
Sep 10th, 2007, 10:21 AM
I wrote a web-app that allows you to click on a document and opens up this content type in the browser. However, my application only handles pdf documents. So, if someone uploads an excel document the link does not work.

How can I create a solution that will allow all document types to be opened in a browser (pdf, xls, txt, etc....) without me setting the content type of each? Also, I am currently storing the document inside the database, so we only store the document extension of the file uploaded.

Jörg Heinicke
Sep 11th, 2007, 04:25 PM
The servlet spec provides support for mapping extensions to content types in web.xml. You can retrieve this mapping in your View implementation (that's what you are probably talking about).

Joerg