ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Two Servlet Filters Every Web Application Should Have
Subject:   MIME types and Servlets that generate binary data
Date:   2003-12-12 13:40:31
From:   anonymous2
Response to: MIME types and Servlets that generate binary data

Also, even if <mime-mapping> worked, it could be a problem if the content type returned by the servlet can differ. EG, imagine an image servlet which takes a GET parameter 'imageType'. Let's say, for discussion's sake, that imageType can be JPEG, GIF, SVG, PNG, etc. In this case, the URL will be distinct for different contentTypes, but <mime-mapping> cannot be used. The above-posted solution works though. I still wonder why Sun didn't include a getContentType method in their default response object.

1 to 1 of 1
  1. MIME types and Servlets that generate binary data
    2003-12-12 14:58:19  jfalkner [View]

    • MIME types and Servlets that generate binary data
      2004-01-26 21:45:24  jleech [View]

1 to 1 of 1