| Article: |
Two Servlet Filters Every Web Application Should Have | |
| Subject: | MIME types and Servlets that generate binary data | |
| Date: | 2003-12-12 14:58:19 | |
| From: | jfalkner | |
|
Response to: MIME types and Servlets that generate binary data
|
||
| True, but a good point is that you can map your servlet to both "MyServlet.jpg" and "MyServlet.png", then use the correct URL based on if you want a JPG or a PNG -- same for other extensions and MIME types. I'd argue this is the way you should do dynamic images/content unless you really must do it a different way. | ||
Showing messages 1 through 1 of 1.
-
MIME types and Servlets that generate binary data
2004-01-26 21:45:24 jleech [View]



Here's a real-world example of a situation where your suggestion wouldn't work -- and you really must do it a different way: A web form that lets the user input a bunch of parameters, including ouput format, e.g. { .pdf, .xml, .csv, .html }.
The only compelling reason I can see to use extensions on the URLs for the content is to satisfy really old, broken versions of Internet Explorer. And you can trick them anyway by appending ?.pdf or &.pdf to the URL...