tomcat mine 大全

tomcat mine 大全

大家好啊我是寻觅

Tomcat在默认情况下下载.rar/.mp3的文件是把文件当作文本文件打开,

导致打开后,不是下载,而是乱码一页,解决方法网上不是很多也

不全面,于是我找了凑在一起弄了这个;


解决方法:

打开conf/web.xml,加入下面的代码.

请大家按需要选择

  1 < mime-mapping >  
  2 < extension > doc </ extension >
  3 < mime-type > application/msword </ mime-type >  
  4 </ mime-mapping >  
  5 < mime-mapping >  
  6 < extension > xls </ extension >  
  7 < mime-type > application/msexcel </ mime-type >  
  8 </ mime-mapping >  
  9 < mime-mapping >  
 10 < extension > pdf </ extension >  
 11 < mime-type > application/pdf </ mime-type >  
 12 </ mime-mapping >
 13 < mime-mapping >  
 14 < extension > zip </ extension >  
 15 < mime-type > application/zip </ mime-type >  
 16 </ mime-mapping >
 17 < mime-mapping >  
 18 < extension > rar </ extension >  
 19 < mime-type > application/rar </ mime-type >  
 20 </ mime-mapping >
 21 < mime-mapping >  
 22 < extension > txt </ extension >  
 23 < mime-type > application/txt </ mime-type >  
 24 </ mime-mapping >
 25 < mime-mapping >  
 26 < extension > chm </ extension >  
 27 < mime-type > application/mshelp </ mime-type >
 28 </ mime-mapping >     
 29 < mime-mapping >
 30 < extension > mht </ extension >
 31 < mime-type > text/x-mht </ mime-type >
 32 </ mime-mapping >
 33 < mime-mapping >
 34 < extension > rar </ extension >
 35 < mime-type > application/octet-stream </ mime-type >
 36 </ mime-mapping >
 37 < mime-mapping >
 38 < extension > iso </ extension >
 39 < mime-type > application/octet-stream </ mime-type >
 40 </ mime-mapping >
 41 < mime-mapping >
 42 < extension > ape </ extension >
 43 < mime-type > application/octet-stream </ mime-type >
 44 </ mime-mapping >
 45 < mime-mapping >
 46 < extension > rmvb </ extension >
 47 < mime-type > application/octet-stream </ mime-type >
 48 </ mime-mapping >
 49 < mime-mapping >
 50 < extension > ico </ extension >
 51 < mime-type > image/x-icon </ mime-type >
 52 </ mime-mapping >
 53 < mime-mapping >
 54 < extension > dsp </ extension >
 55 < mime-type > text/html </ mime-type >
 56 </ mime-mapping >
 57 < mime-mapping >
 58 < extension > gif </ extension >
 59 < mime-type > image/gif </ mime-type >
 60 </ mime-mapping >
 61 < mime-mapping >
 62 < extension > htm </ extension >
 63 < mime-type > text/html </ mime-type >
 64 </ mime-mapping >
 65 < mime-mapping >
 66 < extension > html </ extension >
 67 < mime-type > text/html </ mime-type >
 68 </ mime-mapping >
 69 < mime-mapping >
 70 < extension > jnlp </ extension >
 71 < mime-type > application/x-java-jnlp-file </ mime-type >
 72 </ mime-mapping >
 73 < mime-mapping >
 74 < extension > jpeg </ extension >
 75 < mime-type > image/jpeg </ mime-type >
 76 </ mime-mapping >
 77 < mime-mapping >
 78 < extension > jpg </ extension >
 79 < mime-type > image/jpeg </ mime-type >
 80 </ mime-mapping >
 81 < mime-mapping >
 82 < extension > js </ extension >
 83 < mime-type > application/x-javascript </ mime-type >
 84 </ mime-mapping >
 85 < mime-mapping >
 86 < extension > pdf </ extension >
 87 < mime-type > application/pdf </ mime-type >
 88 </ mime-mapping >
 89 < mime-mapping >
 90 < extension > png </ extension >
 91 < mime-type > image/png </ mime-type >
 92 </ mime-mapping >
 93 < mime-mapping >
 94 < extension > txt </ extension >
 95 < mime-type > text/plain </ mime-type >
 96 </ mime-mapping >
 97 < mime-mapping >
 98 < extension > xls </ extension >
 99 < mime-type > application/vnd.ms-excel </ mime-type >
100 </ mime-mapping >
101 < mime-mapping >
102 < extension > xml </ extension >
103 < mime-type > text/xml </ mime-type >
104 </ mime-mapping >
105 < mime-mapping >
106 < extension > xul </ extension >
107 < mime-type > application/vnd.mozilla.xul-xml </ mime-type >
108 </ mime-mapping >
109 < mime-mapping >
110 < extension > zhtml </ extension >
111 < mime-type > text/html </ mime-type >
112 </ mime-mapping >
113 < mime-mapping >
114 < extension > zip </ extension >
115 < mime-type > application/x-zip </ mime-type >
116 </ mime-mapping >
117 < mime-mapping >
118 < extension > zul </ extension >
119 < mime-type > text/html </ mime-type >
120 </ mime-mapping >
121 < mime-mapping >
122 < extension > foo </ extension >
123 < mime-type > application/x-fubar </ mime-type >
124 </ mime-mapping >
125 < mime-mapping >
126 < extension > ps </ extension >
127 < mime-type > application/postscrīpt </ mime-type >
128 </ mime-mapping >
129
130

其他的,用法和上面一样给个大概:

  1 application/astound asd,asn 
  2 application/bld bld 
  3 application/bld2 bld2 
  4 application/cprplayer pqi 
  5 application/e-score sdf 
  6 application/fastman lcc 
  7 application/font-tdpfr pfr 
  8 application/futuresplash spl 
  9 application/java-archive jar 
 10 application/jwc jwc 
 11 application/lgh lgh 
 12 application/listenup ptlk 
 13 application/mac-binhex40 hqx 
 14 application/mbedlet mbd 
 15 application/metastream mts,mtx,mtz,mzv,rtg, 
 16 application/msword doc 
 17 application/octet-stream avb, AVB, bin, bpk, class, dmg,exe, tad, TAD, ttf,dll  
 18 application/oda oda 
 19 application/pdf pdf 
 20 application/postscript ai,eps,ps 
 21 application/presentations shw 
 22 application/rdf+xml rdf 
 23 application/rtf rtf 
 24 application/smil smi 
 25 application/studiom smp 
 26 application/timbuktu tbt 
 27 application/toc toc 
 28 application/t-time ttz 
 29 application/vnd.fujixerox.docuworks xdw 
 30 application/vnd.lotus-1-2-3 123 
 31 application/vnd.ms-excel xls,xlw,xla,xlc,xlm,xlt 
 32 application/vnd.ms-powerpoint ppt,pps,pot 
 33 application/vnd.ms-project mpp 
 34 application/vnd.rn-realplayer rnx 
 35 application/vnd.wap.wmlc wmlc 
 36 application/winhlp hlp 
 37 application/x-asap asp 
 38 application/x-AtlasMate-Plugin oom 
 39 application/x-authoware-bin aab 
 40 application/x-authoware-map aam 
 41 application/x-authoware-seg aas 
 42 application/x-bzip2 bz2 
 43 application/x-cmx cmx 
 44 application/x-cnc ccn 
 45 application/x-cocoa cco 
 46 application/x-cprplayer pqf 
 47 application/x-csh csh 
 48 application/x-cult3d-object co 丂丂丂 
 49 application/x-digitalloca lcr,lcl 
 50 application/x-director dcr,dir,dxr 
 51 application/x-dot dot 
 52 application/x-dreamcast-vms vms 
 53 application/x-dreamcast-vms-info vmi 
 54 application/x-dvi dvi 
 55 application/x-earthtime etc 
 56 application/x-envoy evy 
 57 application/x-excel xls,xlc,xll,xlm,xlw 
 58 application/x-expandedbook ebk 
 59 application/x-gca-compressed gca 
 60 application/x-gtar gtar 
 61 application/x-gps gps 
 62 application/x-gzip gz,x-gzip 
 63 application/x-hdf hdf 
 64 application/xhtml+xml xhtml,xhtm,xht 
 65 application/x-ipix ipx 
 66 application/x-jam jam 
 67 application/x-javascript js 
 68 application/x-java-jnlp-file jnlp 
 69 application/x-kjx kjx 
 70 application/x-Koan skp,skd,skt,skm 
 71 application/x-latex latex 
 72 application/x-lzh lzh, LZH 
 73 application/x-maker fm 
 74 application/x-mapserver mps 
 75 application/x-mascot mct 
 76 application/x-mif mif,mi 
 77 application/x-mocha mocha,moc 
 78 application/x-mpeg amc 
 79 application/x-mrm mrm 
 80 application/x-mscardfile crd 
 81 application/x-msaccess mdb 
 82 application/x-msclip clp 
 83 application/x-msmediaview m13,m14 
 84 application/x-msmetafile wmf 
 85 application/x-msmoney mny 
 86 application/x-mspublisher pub 
 87 application/x-msschedule scd 
 88 application/x-msterminal trm 
 89 application/x-mswrite wri 
 90 application/x-NET-Install ins 
 91 application/x-netcdf nc,cdf 
 92 application/x-netfpx npx 
 93 application/x-neva1 nva 
 94 application/x-nif nif 
 95 application/x-ns-proxy-autoconfig proxy 
 96 application/x-pan pan 
 97 application/x-perl pm 
 98 application/x-pmd pmd 
 99 application/x-prc prc 
100 application/x-richlink rlf 
101 application/x-rogerwilco rwc 
102 application/x-salsa slc 
103 application/x-scream nmz 
104 application/x-sh sh 
105 application/x-shar shar 
106 application/x-shockwave-flash swf,swfl 
107 application/x-smaf mmf 
108 application/x-sprite spr,sprite 
109 application/x-spt spt 
110 application/x-supercard sca 
111 application/x-stuffit sit,sea 
112 application/x-tar tar,tgz,taz 
113 application/x-tcl tcl 
114 application/x-tex tex 
115 application/x-texinfo texinfo,texi 
116 application/x-timbuktu tbp 
117 application/x-tkined tki,tkined 
118 application/x-troff t,tr,roff 
119 application/x-troff-man man 
120 application/x-troff-me me 
121 application/x-troff-ms ms 
122 application/x-wais-source src 
123 application/x-wxl wxl 
124 application/x-xdma xdm,xdma 
125 application/x-xpinstall xpi 
126 application/x-yumekara mof 
127 application/x-yz1 yz1 
128 application/x-zaurus-zac zac 
129 application/zip zip,nar 
130 audio/basic au,snd 
131 audio/echospeech es,esl 
132 audio/midi mid,midi 
133 audio/tsplayer tsi 
134 audio/vnd.qcelp qcp 
135 audio/voxware vox 
136 audio/x-aiff aif,aiff,aifc 
137 audio/X-Alpha5 als 
138 audio/x-epac pae 
139 audio/x-imy imy 
140 audio/x-mio mio 
141 audio/x-mod mod, s3z, xm, it, s3m, xmz, itz, mdz 
142 audio/x-mpeg mp2, mp3 
143 audio/x-mpegurl m3u 
144 audio/x-ms-wax wax 
145 audio/x-ms-wma wma 
146 audio/x-pn-realaudio ra, ram, rm 
147 audio/x-pac pac 
148 audio/x-pn-RealAudio-plugin rpm 
149 audio/x-smd smd,smz 
150 audio/x-twinvq vqf, vql 
151 audio/x-twinvq-plugin vqe 
152 audio/x-wav wav 
153 chemical/x-pdb pdb 
154 chemical/x-csml csm,csml 
155 chemical/x-gaussian-input gau 
156 chemical/x-embl-dl-nucleotide emb,embl 
157 chemical/x-mdl-molfile mol 
158 chemical/x-xyz xyz 
159 chemical/x-mopac-input mop 
160 drawing/x-dwf dwf 
161 image/bmp bmp 
162 image/cis-cod cod 
163 image/fif fif 
164 image/gif gif,ifm 
165 image/ief ief 
166 image/ifs ifs 
167 image/jpeg jpeg,jpg,jpe,jpz 
168 image/j2k j2k 
169 image/png png,pnz 
170 image/svg-xml svg 
171 image/svh svh 
172 image/tiff tiff,tif 
173 image/vnd dwg,svf 
174 image/vnd.rn-realflash rf 
175 image/vnd.rn-realpix rp 
176 image/vnd.wap.wbmp wbmp 
177 image/wavelet wi 
178 image/x-cals mil,cal 
179 image/x-cmu-raster ras 
180 image/x-dcx dcx 
181 image/x-dxf dxf 
182 image/x-eri eri 
183 image/x-freehand fh4,fh5,fhc 
184 image/x-fpx fpx,FPX 
185 image/x-icon ico 
186 image/x-pcx pcx 
187 image/x-pda pda 
188 image/x-pict pict 
189 image/x-portable-anymap pnm 
190 image/x-portable-bitmap pbm 
191 image/x-portable-graymap pgm 
192 image/x-portable-pixmap ppm 
193 image/x-quicktime qtif, qti丂丂丂  
194 image/x-rgb rgb 
195 image/x-up-wpng wpng 
196 image/x-xbitmap xbm 
197 image/x-xpixmap xpm 
198 image/x-xwindowdump xwd 
199 i-world/i-vrml ivr 
200 magnus-internal/imagemap map 
201 magnus-internal/parsed-html shtml 
202 magnus-internal/cgi cgi 
203 text/css css 
204 text/html htm,html 
205 text/plain txt,asc 
206 text/richtext rtx 
207 text/tab-separated-values tsv 
208 text/vnd.rn-realtext rt 
209 text/vnd.rn-realtext3d r3t 
210 text/vnd.sun.j2me.app-descriptor jad 
211 text/vnd.wap.wml wml 
212 text/vnd.wap.wmlscript wmls 
213 text/xml xml,xsl 
214 text/xul xul 
215 text/x-hdml hdml,hdm 
216 text/x-mrml mrl 
217 text/x-setext etx 
218 text/x-speech talk,spc 
219 text/x-vcard vcf 
220 video/3gpp 3gp 
221 video/isivideo fvi 
222 video/mpeg mpeg,mpg,mpe 
223 video/msvideo avi 
224 video/quicktime qt,mov 
225 video/vdo vdo 
226 video/vivo viv,vivo 
227 video/vnd.rn-realvideo rv 
228 video/wavelet wv 
229 video/x-mng mng 
230 video/x-ms-asf asf,asx,lsf,lsx,wm 
231 video/x-ms-wmv wmv 
232 video/x-ms-wmx wmx 
233 video/x-ms-wvx wvx 
234 video/mp4 mp4,mpg4 
235 video/x-pv-pvx pvx 
236 video/x-sgi-movie movie 
237 workbook/formulaone vts 
238 x-conference/x-cooltalk ice 
239 x-gzip gz 
240 x-compress z 
241 x-lml/x-lml lml 
242 x-lml/x-lmlpack lmlpack 
243 x-lml/x-evm evm, dcm 
244 x-lml/x-ndb ndb 
245 x-lml/x-lak lak 
246 x-lml/x-gdb gdb 
247 x-lml/x-gps trk, wpt, rte 
248 x-rar-compressed rar 
249 x-uuencode uu, uue 
250 x-world/x-svr svr 
251 x-world/x-vrml wrl, wrz, WRL, WRZ 
252 x-world/x-vrt vrt 
253 x-world/x-vream vrw,vre 
254
255 MIME增补
256 <!-- MIME Type -->  
257 < mime-mapping  extension ='.hdml'  mime-type ='text/x-hdml;charset=KS_C_5601-1987'  />  
258 < mime-mapping  extension ='.wbmp'  mime-type ='image/vnd.wap.wbmp'  />
259 < mime-mapping  extension ='.wml'  mime-type ='text/vnd.wap.wml'  />  
260 < mime-mapping  extension ='.wmlc'  mime-type ='application/vnd.wap.wmlc'/> 
261 <mime-mapping extension ='.wmlsc'  mime-type ='application/vnd.wap.wmlscriptc'  />  
262 < mime-mapping  extension ='.wmls'  mime-type ='text/vnd.wap.wmlscript'  />  
263 < mime-mapping  extension ='.wmlscript'  mime-type ='text/vnd.wap.wmlscript'  />  
264 < mime-mapping  extension ='.ws'  mime-type ='text/vnd.wap.wmlscript'  />  
265 < mime-mapping  extension ='.wsc'  mime-type ='application/vnd.wap.wmlscriptc'  />  
266 < mime-mapping  extension ='.mmf'  mime-type ='application/x-skt-lbs'  />  
267 < mime-mapping  extension ='.si9'  mime-type ='image/vnd.lgtwap.sis'  />  
268 < mime-mapping  extension ='.si7'  mime-type ='image/vnd.stiwap.sis'  />
269 < mime-mapping  extension ='.nbmp'  mime-type ='image/nbmp'  />  
270 < mime-mapping  extension ='.sis'  mime-type ='image/sis'  />  
271 < mime-mapping  extension ='.si6'  mime-type ='image/si6'  />  
272 < mime-mapping  extension ='.toy'  mime-type ='image/toy'  />  
273 < mime-mapping  extension ='.nsnd'  mime-type ='audio/nsnd'  />  
274 < mime-mapping  extension ='.ma1'  mime-type ='audio/ma1'  />  
275 < mime-mapping  extension ='.ma2'  mime-type ='audio/ma2'  />  
276 < mime-mapping  extension ='.pmd'  mime-type ='audio/pmd'  />
277 < mime-mapping  extension ='.vib'  mime-type ='audio/vib'  />
278 < mime-mapping  extension ='.ma3'  mime-type ='audio/ma3'  />
279 < mime-mapping  extension ='.ma5'  mime-type ='audio/ma5'  />
280 < mime-mapping  extension ='.ndwn'  mime-type ='application/ndwn'  />
281
282


地震让大伙知道:居安思危,才是生存之道。

你可能感兴趣的:(tomcat mine 大全)