设置响应类型
resp.setContentType("MIME")
该方法可通过MIME-Type设置响应类型。
以下就是所有响应类型和对应的字符串
Type Meaning
application/msword Microsoft Word document
application/octet-stream Unrecognized or binary data
application/pdf Acrobat (.pdf) file
application/postscript PostScript file
application/vnd.lotus-notes Lotus Notes file
application/vnd.ms-excel Excel spreadsheet
application/vnd.ms-powerpoint PowerPoint presentation
application/x-gzip Gzip archive
application/x-java-archive JAR file
application/x-java-serialized-object Serialized Java object
application/x-java-vm Java bytecode (.class) file
application/zip Zip archive
application/json JSON
audio/basic Sound file in .au or .snd format
audio/midi MIDI sound file
audio/x-aiff AIFF sound file
audio/x-wav Microsoft Windows sound file
image/gif GIF image
image/jpeg JPEG image
image/png PNG image
image/tiff TIFF image
image/x-xbitmap X Windows bitmap image
text/css HTML cascading style sheet
text/html HTML document
text/plain Plain text
text/xml XML
video/mpeg MPEG video clip
video/quicktime QuickTime video clip