Monday, 9 September 2013

difference between mime-mapping and setcontenttype

difference between mime-mapping and setcontenttype

When a servlet sends a response to a client, the browser needs to know how
to render the information received. Consequently, the server can construct
a response to notify the client of the MIME type, by using two different
approaches: 1. By using the HttpServletResponse�s method:
setContentType(�) 2. 2.By using the mime-mapping tag in the web.xml
file for the web application
Does it means I could choose either approach? If I won't call
setContentType(...), how could the browser know the content type? If I
have to call setContentType(...), what is mime-mapping for?

No comments:

Post a Comment