在做项目的时候,选用Jquery的Ajax请求,刚解决中文乱码问题,又出现了一个新问题,ajax请求出现406错误。
图 - 406错误
解决过程:从myeclipse中自带的tomcat转到tomcat7,出现了莫名奇妙的报406错误。经过调试查找,发现原来是tomcat/conf/web.xml问题。只要把myclipse的web.xml替换原来的tomcat下的文件即可。
图 – tomcat7的web.xml和myeclipse中自带的web.xml
替换成功之后发现确实正常了,不过目前不确定文件从164k变成50k有什么影响,有待考证。
图 –使用myeclipse中自带的web.xml结果
下面附上代码:
前台页面js代码:
1 $.ajax({ 2 3 url: 'chat/xxx.h', 4 5 type: 'POST', 6 7 data: {msg:msg}, 8 9 dataType: 'json', 10 11 error: function(){ 12 13 alert('Error Send Server'); 14 15 }, 16 17 success: function(result){ 18 19 //alert("请求成功"+ result) 20 21 }, 22 23 beforeSend: function(){ 24 25 //发送请求前调用,可以放一些"正在加载"之类额话 26 27 //alert("正在加载"); 28 29 }});
后台Java(Spring MVC)代码:
@RequestMapping(value = "/xxx", produces = "text/plain; charset=utf-8") public @ResponseBody String interactionMessage(@RequestParam("msg") String msg){ return new Gson().toJson(msg); }
另:解决ajax返回json字符串解决中文乱码方法与网上方法不同,无需增加jackson.jar包,也无需stringHttpMessageConverter 为 bean 配置什么 属性。我的解决方法是:只需要在@RequestMapping(value = "/xxx", produces = "text/plain; charset=utf-8"),配置produces属性即可。这样就是返回的utf-8编码了,也不知道这种方法好不好,就这样吧。也许是投机取巧,还请大家赐教。
代码:spring-mvc-config.xml文件中配置
<bean id="stringHttpMessageConverter" class="org.springframework.http.converter.StringHttpMessageConverter"> </bean>
附件包含解决方法中提到的 myeclipse下的web.xml文件。
myeclipse下的web.xml文件:
1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 <web-app xmlns="http://java.sun.com/xml/ns/javaee" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 5 version="2.5"> 6 7 <!-- ======================== Introduction ============================== --> 8 <!-- This document defines default values for *all* web applications --> 9 <!-- loaded into this instance of Tomcat. As each application is --> 10 <!-- deployed, this file is processed, followed by the --> 11 <!-- "/WEB-INF/web.xml" deployment descriptor from your own --> 12 <!-- applications. --> 13 <!-- --> 14 <!-- WARNING: Do not configure application-specific resources here! --> 15 <!-- They should go in the "/WEB-INF/web.xml" file in your application. --> 16 17 18 <!-- ================== Built In Servlet Definitions ==================== --> 19 20 21 <!-- The default servlet for all web applications, that serves static --> 22 <!-- resources. It processes all requests that are not mapped to other --> 23 <!-- servlets with servlet mappings (defined either here or in your own --> 24 <!-- web.xml file. This servlet supports the following initialization --> 25 <!-- parameters (default values are in square brackets): --> 26 <!-- --> 27 <!-- debug Debugging detail level for messages logged --> 28 <!-- by this servlet. [0] --> 29 <!-- --> 30 <!-- fileEncoding Encoding to be used to read static resources --> 31 <!-- [platform default] --> 32 <!-- --> 33 <!-- input Input buffer size (in bytes) when reading --> 34 <!-- resources to be served. [2048] --> 35 <!-- --> 36 <!-- listings Should directory listings be produced if there --> 37 <!-- is no welcome file in this directory? [false] --> 38 <!-- WARNING: Listings for directories with many --> 39 <!-- entries can be slow and may consume --> 40 <!-- significant proportions of server resources. --> 41 <!-- --> 42 <!-- output Output buffer size (in bytes) when writing --> 43 <!-- resources to be served. [2048] --> 44 <!-- --> 45 <!-- readonly Is this context "read only", so HTTP --> 46 <!-- commands like PUT and DELETE are --> 47 <!-- rejected? [true] --> 48 <!-- --> 49 <!-- readmeFile File name to display with the directory --> 50 <!-- contents. [null] --> 51 <!-- --> 52 <!-- sendfileSize If the connector used supports sendfile, this --> 53 <!-- represents the minimal file size in KB for --> 54 <!-- which sendfile will be used. Use a negative --> 55 <!-- value to always disable sendfile. [48] --> 56 <!-- --> 57 <!-- For directory listing customization. Checks localXsltFile, then --> 58 <!-- globalXsltFile, then defaults to original behavior. --> 59 <!-- --> 60 <!-- localXsltFile Make directory listings an XML doc and --> 61 <!-- pass the result to this style sheet residing --> 62 <!-- in that directory. This overrides --> 63 <!-- globalXsltFile[null] --> 64 <!-- --> 65 <!-- globalXsltFile Site wide configuration version of --> 66 <!-- localXsltFile This argument is expected --> 67 <!-- to be a physical file. [null] --> 68 <!-- --> 69 <!-- --> 70 71 <servlet> 72 <servlet-name>default</servlet-name> 73 <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class> 74 <init-param> 75 <param-name>debug</param-name> 76 <param-value>0</param-value> 77 </init-param> 78 <init-param> 79 <param-name>listings</param-name> 80 <param-value>false</param-value> 81 </init-param> 82 <load-on-startup>1</load-on-startup> 83 </servlet> 84 85 86 <!-- The "invoker" servlet, which executes anonymous servlet classes --> 87 <!-- that have not been defined in a web.xml file. Traditionally, this --> 88 <!-- servlet is mapped to the URL pattern "/servlet/*", but you can map --> 89 <!-- it to other patterns as well. The extra path info portion of such a --> 90 <!-- request must be the fully qualified class name of a Java class that --> 91 <!-- implements Servlet (or extends HttpServlet), or the servlet name --> 92 <!-- of an existing servlet definition. This servlet supports the --> 93 <!-- following initialization parameters (default values are in square --> 94 <!-- brackets): --> 95 <!-- --> 96 <!-- debug Debugging detail level for messages logged --> 97 <!-- by this servlet. [0] --> 98 99 <!-- 100 <servlet> 101 <servlet-name>invoker</servlet-name> 102 <servlet-class> 103 org.apache.catalina.servlets.InvokerServlet 104 </servlet-class> 105 <init-param> 106 <param-name>debug</param-name> 107 <param-value>0</param-value> 108 </init-param> 109 <load-on-startup>2</load-on-startup> 110 </servlet> 111 --> 112 113 114 <!-- The JSP page compiler and execution servlet, which is the mechanism --> 115 <!-- used by Tomcat to support JSP pages. Traditionally, this servlet --> 116 <!-- is mapped to the URL pattern "*.jsp". This servlet supports the --> 117 <!-- following initialization parameters (default values are in square --> 118 <!-- brackets): --> 119 <!-- --> 120 <!-- checkInterval If development is false and checkInterval is --> 121 <!-- greater than zero, background compilations are --> 122 <!-- enabled. checkInterval is the time in seconds --> 123 <!-- between checks to see if a JSP page needs to --> 124 <!-- be recompiled. [0] --> 125 <!-- --> 126 <!-- modificationTestInterval --> 127 <!-- Causes a JSP (and its dependent files) to not --> 128 <!-- be checked for modification during the --> 129 <!-- specified time interval (in seconds) from the --> 130 <!-- last time the JSP was checked for --> 131 <!-- modification. A value of 0 will cause the JSP --> 132 <!-- to be checked on every access. --> 133 <!-- Used in development mode only. [4] --> 134 <!-- --> 135 <!-- compiler Which compiler Ant should use to compile JSP --> 136 <!-- pages. See the jasper documentation for more --> 137 <!-- information. --> 138 <!-- --> 139 <!-- classdebuginfo Should the class file be compiled with --> 140 <!-- debugging information? [true] --> 141 <!-- --> 142 <!-- classpath What class path should I use while compiling --> 143 <!-- generated servlets? [Created dynamically --> 144 <!-- based on the current web application] --> 145 <!-- --> 146 <!-- development Is Jasper used in development mode? If true, --> 147 <!-- the frequency at which JSPs are checked for --> 148 <!-- modification may be specified via the --> 149 <!-- modificationTestInterval parameter. [true] --> 150 <!-- --> 151 <!-- enablePooling Determines whether tag handler pooling is --> 152 <!-- enabled [true] --> 153 <!-- --> 154 <!-- fork Tell Ant to fork compiles of JSP pages so that --> 155 <!-- a separate JVM is used for JSP page compiles --> 156 <!-- from the one Tomcat is running in. [true] --> 157 <!-- --> 158 <!-- ieClassId The class-id value to be sent to Internet --> 159 <!-- Explorer when using <jsp:plugin> tags. --> 160 <!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] --> 161 <!-- --> 162 <!-- javaEncoding Java file encoding to use for generating java --> 163 <!-- source files. [UTF8] --> 164 <!-- --> 165 <!-- keepgenerated Should we keep the generated Java source code --> 166 <!-- for each page instead of deleting it? [true] --> 167 <!-- --> 168 <!-- mappedfile Should we generate static content with one --> 169 <!-- print statement per input line, to ease --> 170 <!-- debugging? [true] --> 171 <!-- --> 172 <!-- trimSpaces Should white spaces in template text between --> 173 <!-- actions or directives be trimmed? [false] --> 174 <!-- --> 175 <!-- suppressSmap Should the generation of SMAP info for JSR45 --> 176 <!-- debugging be suppressed? [false] --> 177 <!-- --> 178 <!-- dumpSmap Should the SMAP info for JSR45 debugging be --> 179 <!-- dumped to a file? [false] --> 180 <!-- False if suppressSmap is true --> 181 <!-- --> 182 <!-- genStrAsCharArray Should text strings be generated as char --> 183 <!-- arrays, to improve performance in some cases? --> 184 <!-- [false] --> 185 <!-- --> 186 <!-- errorOnUseBeanInvalidClassAttribute --> 187 <!-- Should Jasper issue an error when the value of --> 188 <!-- the class attribute in an useBean action is --> 189 <!-- not a valid bean class? [true] --> 190 <!-- --> 191 <!-- scratchdir What scratch directory should we use when --> 192 <!-- compiling JSP pages? [default work directory --> 193 <!-- for the current web application] --> 194 <!-- --> 195 <!-- xpoweredBy Determines whether X-Powered-By response --> 196 <!-- header is added by generated servlet [false] --> 197 <!-- --> 198 <!-- compilerTargetVM Compiler target VM --> 199 <!-- default is System.properties --> 200 <!-- java.specification.version > 1.4 --> 201 <!-- [1.5] else [1.4] --> 202 <!-- --> 203 <!-- compilerSourceVM Compiler source VM --> 204 <!-- default is System.properties --> 205 <!-- java.specification.version > 1.4 --> 206 <!-- [1.5] else [1.4] --> 207 <!-- --> 208 <!-- If you wish to use Jikes to compile JSP pages: --> 209 <!-- Please see the "Using Jikes" section of the Jasper-HowTo --> 210 <!-- page in the Tomcat documentation. --> 211 212 <servlet> 213 <servlet-name>jsp</servlet-name> 214 <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> 215 <init-param> 216 <param-name>fork</param-name> 217 <param-value>false</param-value> 218 </init-param> 219 <init-param> 220 <param-name>xpoweredBy</param-name> 221 <param-value>false</param-value> 222 </init-param> 223 <load-on-startup>3</load-on-startup> 224 </servlet> 225 226 227 <!-- NOTE: An SSI Filter is also available as an alternative SSI --> 228 <!-- implementation. Use either the Servlet or the Filter but NOT both. --> 229 <!-- --> 230 <!-- Server Side Includes processing servlet, which processes SSI --> 231 <!-- directives in HTML pages consistent with similar support in web --> 232 <!-- servers like Apache. Traditionally, this servlet is mapped to the --> 233 <!-- URL pattern "*.shtml". This servlet supports the following --> 234 <!-- initialization parameters (default values are in square brackets): --> 235 <!-- --> 236 <!-- buffered Should output from this servlet be buffered? --> 237 <!-- (0=false, 1=true) [0] --> 238 <!-- --> 239 <!-- debug Debugging detail level for messages logged --> 240 <!-- by this servlet. [0] --> 241 <!-- --> 242 <!-- expires The number of seconds before a page with SSI --> 243 <!-- directives will expire. [No default] --> 244 <!-- --> 245 <!-- isVirtualWebappRelative --> 246 <!-- Should "virtual" paths be interpreted as --> 247 <!-- relative to the context root, instead of --> 248 <!-- the server root? (0=false, 1=true) [0] --> 249 <!-- --> 250 <!-- inputEncoding The encoding to assume for SSI resources if --> 251 <!-- one is not available from the resource. --> 252 <!-- [Platform default] --> 253 <!-- --> 254 <!-- outputEncoding The encoding to use for the page that results --> 255 <!-- from the SSI processing. [UTF-8] --> 256 <!-- --> 257 <!-- --> 258 <!-- IMPORTANT: To use the SSI servlet, you also need to rename the --> 259 <!-- $CATALINA_HOME/server/lib/servlets-ssi.renametojar file --> 260 <!-- to $CATALINA_HOME/server/lib/servlets-ssi.jar --> 261 262 <!-- 263 <servlet> 264 <servlet-name>ssi</servlet-name> 265 <servlet-class> 266 org.apache.catalina.ssi.SSIServlet 267 </servlet-class> 268 <init-param> 269 <param-name>buffered</param-name> 270 <param-value>1</param-value> 271 </init-param> 272 <init-param> 273 <param-name>debug</param-name> 274 <param-value>0</param-value> 275 </init-param> 276 <init-param> 277 <param-name>expires</param-name> 278 <param-value>666</param-value> 279 </init-param> 280 <init-param> 281 <param-name>isVirtualWebappRelative</param-name> 282 <param-value>0</param-value> 283 </init-param> 284 <load-on-startup>4</load-on-startup> 285 </servlet> 286 --> 287 288 289 <!-- Common Gateway Includes (CGI) processing servlet, which supports --> 290 <!-- execution of external applications that conform to the CGI spec --> 291 <!-- requirements. Typically, this servlet is mapped to the URL pattern --> 292 <!-- "/cgi-bin/*", which means that any CGI applications that are --> 293 <!-- executed must be present within the web application. This servlet --> 294 <!-- supports the following initialization parameters (default values --> 295 <!-- are in square brackets): --> 296 <!-- --> 297 <!-- cgiPathPrefix The CGI search path will start at --> 298 <!-- webAppRootDir + File.separator + this prefix. --> 299 <!-- [WEB-INF/cgi] --> 300 <!-- --> 301 <!-- debug Debugging detail level for messages logged --> 302 <!-- by this servlet. [0] --> 303 <!-- --> 304 <!-- executable Name of the exectuable used to run the --> 305 <!-- script. [perl] --> 306 <!-- --> 307 <!-- parameterEncoding Name of parameter encoding to be used with --> 308 <!-- CGI servlet. --> 309 <!-- [System.getProperty("file.encoding","UTF-8")] --> 310 <!-- --> 311 <!-- passShellEnvironment Should the shell environment variables (if --> 312 <!-- any) be passed to the CGI script? [false] --> 313 <!-- --> 314 <!-- IMPORTANT: To use the CGI servlet, you also need to rename the --> 315 <!-- $CATALINA_HOME/server/lib/servlets-cgi.renametojar file --> 316 <!-- to $CATALINA_HOME/server/lib/servlets-cgi.jar --> 317 318 <!-- 319 <servlet> 320 <servlet-name>cgi</servlet-name> 321 <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class> 322 <init-param> 323 <param-name>debug</param-name> 324 <param-value>0</param-value> 325 </init-param> 326 <init-param> 327 <param-name>cgiPathPrefix</param-name> 328 <param-value>WEB-INF/cgi</param-value> 329 </init-param> 330 <load-on-startup>5</load-on-startup> 331 </servlet> 332 --> 333 334 335 <!-- ================ Built In Servlet Mappings ========================= --> 336 337 338 <!-- The servlet mappings for the built in servlets defined above. Note --> 339 <!-- that, by default, the CGI and SSI servlets are *not* mapped. You --> 340 <!-- must uncomment these mappings (or add them to your application's own --> 341 <!-- web.xml deployment descriptor) to enable these services --> 342 343 <!-- The mapping for the default servlet --> 344 <servlet-mapping> 345 <servlet-name>default</servlet-name> 346 <url-pattern>/</url-pattern> 347 </servlet-mapping> 348 349 <!-- The mapping for the invoker servlet --> 350 <!-- 351 <servlet-mapping> 352 <servlet-name>invoker</servlet-name> 353 <url-pattern>/servlet/*</url-pattern> 354 </servlet-mapping> 355 --> 356 357 <!-- The mapping for the JSP servlet --> 358 <servlet-mapping> 359 <servlet-name>jsp</servlet-name> 360 <url-pattern>*.jsp</url-pattern> 361 </servlet-mapping> 362 363 <servlet-mapping> 364 <servlet-name>jsp</servlet-name> 365 <url-pattern>*.jspx</url-pattern> 366 </servlet-mapping> 367 368 <!-- The mapping for the SSI servlet --> 369 <!-- 370 <servlet-mapping> 371 <servlet-name>ssi</servlet-name> 372 <url-pattern>*.shtml</url-pattern> 373 </servlet-mapping> 374 --> 375 376 <!-- The mapping for the CGI Gateway servlet --> 377 378 <!-- 379 <servlet-mapping> 380 <servlet-name>cgi</servlet-name> 381 <url-pattern>/cgi-bin/*</url-pattern> 382 </servlet-mapping> 383 --> 384 385 386 <!-- ================== Built In Filter Definitions ===================== --> 387 388 <!-- NOTE: An SSI Servlet is also available as an alternative SSI --> 389 <!-- implementation. Use either the Servlet or the Filter but NOT both. --> 390 <!-- --> 391 <!-- Server Side Includes processing filter, which processes SSI --> 392 <!-- directives in HTML pages consistent with similar support in web --> 393 <!-- servers like Apache. Traditionally, this filter is mapped to the --> 394 <!-- URL pattern "*.shtml", though it can be mapped to "*" as it will --> 395 <!-- selectively enable/disable SSI processing based on mime types. For --> 396 <!-- this to work you will need to uncomment the .shtml mime type --> 397 <!-- definition towards the bottom of this file. --> 398 <!-- The contentType init param allows you to apply SSI processing to JSP --> 399 <!-- pages, javascript, or any other content you wish. This filter --> 400 <!-- supports the following initialization parameters (default values are --> 401 <!-- in square brackets): --> 402 <!-- --> 403 <!-- contentType A regex pattern that must be matched before --> 404 <!-- SSI processing is applied. --> 405 <!-- [text/x-server-parsed-html(;.*)?] --> 406 <!-- --> 407 <!-- debug Debugging detail level for messages logged --> 408 <!-- by this servlet. [0] --> 409 <!-- --> 410 <!-- expires The number of seconds before a page with SSI --> 411 <!-- directives will expire. [No default] --> 412 <!-- --> 413 <!-- isVirtualWebappRelative --> 414 <!-- Should "virtual" paths be interpreted as --> 415 <!-- relative to the context root, instead of --> 416 <!-- the server root? (0=false, 1=true) [0] --> 417 <!-- --> 418 <!-- --> 419 <!-- IMPORTANT: To use the SSI filter, you also need to rename the --> 420 <!-- $CATALINA_HOME/server/lib/servlets-ssi.renametojar file --> 421 <!-- to $CATALINA_HOME/server/lib/servlets-ssi.jar --> 422 423 <!-- 424 <filter> 425 <filter-name>ssi</filter-name> 426 <filter-class> 427 org.apache.catalina.ssi.SSIFilter 428 </filter-class> 429 <init-param> 430 <param-name>contentType</param-name> 431 <param-value>text/x-server-parsed-html(;.*)?</param-value> 432 </init-param> 433 <init-param> 434 <param-name>debug</param-name> 435 <param-value>0</param-value> 436 </init-param> 437 <init-param> 438 <param-name>expires</param-name> 439 <param-value>666</param-value> 440 </init-param> 441 <init-param> 442 <param-name>isVirtualWebappRelative</param-name> 443 <param-value>0</param-value> 444 </init-param> 445 </filter> 446 --> 447 448 449 <!-- ==================== Built In Filter Mappings ====================== --> 450 451 <!-- The mapping for the SSI Filter --> 452 <!-- 453 <filter-mapping> 454 <filter-name>ssi</filter-name> 455 <url-pattern>*.shtml</url-pattern> 456 </filter-mapping> 457 --> 458 459 460 <!-- ==================== Default Session Configuration ================= --> 461 <!-- You can set the default session timeout (in minutes) for all newly --> 462 <!-- created sessions by modifying the value below. --> 463 464 <session-config> 465 <session-timeout>30</session-timeout> 466 </session-config> 467 468 469 <!-- ===================== Default MIME Type Mappings =================== --> 470 <!-- When serving static resources, Tomcat will automatically generate --> 471 <!-- a "Content-Type" header based on the resource's filename extension, --> 472 <!-- based on these mappings. Additional mappings can be added here (to --> 473 <!-- apply to all web applications), or in your own application's web.xml --> 474 <!-- deployment descriptor. --> 475 476 <mime-mapping> 477 <extension>abs</extension> 478 <mime-type>audio/x-mpeg</mime-type> 479 </mime-mapping> 480 <mime-mapping> 481 <extension>ai</extension> 482 <mime-type>application/postscript</mime-type> 483 </mime-mapping> 484 <mime-mapping> 485 <extension>aif</extension> 486 <mime-type>audio/x-aiff</mime-type> 487 </mime-mapping> 488 <mime-mapping> 489 <extension>aifc</extension> 490 <mime-type>audio/x-aiff</mime-type> 491 </mime-mapping> 492 <mime-mapping> 493 <extension>aiff</extension> 494 <mime-type>audio/x-aiff</mime-type> 495 </mime-mapping> 496 <mime-mapping> 497 <extension>aim</extension> 498 <mime-type>application/x-aim</mime-type> 499 </mime-mapping> 500 <mime-mapping> 501 <extension>art</extension> 502 <mime-type>image/x-jg</mime-type> 503 </mime-mapping> 504 <mime-mapping> 505 <extension>asf</extension> 506 <mime-type>video/x-ms-asf</mime-type> 507 </mime-mapping> 508 <mime-mapping> 509 <extension>asx</extension> 510 <mime-type>video/x-ms-asf</mime-type> 511 </mime-mapping> 512 <mime-mapping> 513 <extension>au</extension> 514 <mime-type>audio/basic</mime-type> 515 </mime-mapping> 516 <mime-mapping> 517 <extension>avi</extension> 518 <mime-type>video/x-msvideo</mime-type> 519 </mime-mapping> 520 <mime-mapping> 521 <extension>avx</extension> 522 <mime-type>video/x-rad-screenplay</mime-type> 523 </mime-mapping> 524 <mime-mapping> 525 <extension>bcpio</extension> 526 <mime-type>application/x-bcpio</mime-type> 527 </mime-mapping> 528 <mime-mapping> 529 <extension>bin</extension> 530 <mime-type>application/octet-stream</mime-type> 531 </mime-mapping> 532 <mime-mapping> 533 <extension>bmp</extension> 534 <mime-type>image/bmp</mime-type> 535 </mime-mapping> 536 <mime-mapping> 537 <extension>body</extension> 538 <mime-type>text/html</mime-type> 539 </mime-mapping> 540 <mime-mapping> 541 <extension>cdf</extension> 542 <mime-type>application/x-cdf</mime-type> 543 </mime-mapping> 544 <mime-mapping> 545 <extension>cer</extension> 546 <mime-type>application/x-x509-ca-cert</mime-type> 547 </mime-mapping> 548 <mime-mapping> 549 <extension>class</extension> 550 <mime-type>application/java</mime-type> 551 </mime-mapping> 552 <mime-mapping> 553 <extension>cpio</extension> 554 <mime-type>application/x-cpio</mime-type> 555 </mime-mapping> 556 <mime-mapping> 557 <extension>csh</extension> 558 <mime-type>application/x-csh</mime-type> 559 </mime-mapping> 560 <mime-mapping> 561 <extension>css</extension> 562 <mime-type>text/css</mime-type> 563 </mime-mapping> 564 <mime-mapping> 565 <extension>dib</extension> 566 <mime-type>image/bmp</mime-type> 567 </mime-mapping> 568 <mime-mapping> 569 <extension>doc</extension> 570 <mime-type>application/msword</mime-type> 571 </mime-mapping> 572 <mime-mapping> 573 <extension>dtd</extension> 574 <mime-type>application/xml-dtd</mime-type> 575 </mime-mapping> 576 <mime-mapping> 577 <extension>dv</extension> 578 <mime-type>video/x-dv</mime-type> 579 </mime-mapping> 580 <mime-mapping> 581 <extension>dvi</extension> 582 <mime-type>application/x-dvi</mime-type> 583 </mime-mapping> 584 <mime-mapping> 585 <extension>eps</extension> 586 <mime-type>application/postscript</mime-type> 587 </mime-mapping> 588 <mime-mapping> 589 <extension>etx</extension> 590 <mime-type>text/x-setext</mime-type> 591 </mime-mapping> 592 <mime-mapping> 593 <extension>exe</extension> 594 <mime-type>application/octet-stream</mime-type> 595 </mime-mapping> 596 <mime-mapping> 597 <extension>gif</extension> 598 <mime-type>image/gif</mime-type> 599 </mime-mapping> 600 <mime-mapping> 601 <extension>gtar</extension> 602 <mime-type>application/x-gtar</mime-type> 603 </mime-mapping> 604 <mime-mapping> 605 <extension>gz</extension> 606 <mime-type>application/x-gzip</mime-type> 607 </mime-mapping> 608 <mime-mapping> 609 <extension>hdf</extension> 610 <mime-type>application/x-hdf</mime-type> 611 </mime-mapping> 612 <mime-mapping> 613 <extension>hqx</extension> 614 <mime-type>application/mac-binhex40</mime-type> 615 </mime-mapping> 616 <mime-mapping> 617 <extension>htc</extension> 618 <mime-type>text/x-component</mime-type> 619 </mime-mapping> 620 <mime-mapping> 621 <extension>htm</extension> 622 <mime-type>text/html</mime-type> 623 </mime-mapping> 624 <mime-mapping> 625 <extension>html</extension> 626 <mime-type>text/html</mime-type> 627 </mime-mapping> 628 <mime-mapping> 629 <extension>hqx</extension> 630 <mime-type>application/mac-binhex40</mime-type> 631 </mime-mapping> 632 <mime-mapping> 633 <extension>ief</extension> 634 <mime-type>image/ief</mime-type> 635 </mime-mapping> 636 <mime-mapping> 637 <extension>jad</extension> 638 <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type> 639 </mime-mapping> 640 <mime-mapping> 641 <extension>jar</extension> 642 <mime-type>application/java-archive</mime-type> 643 </mime-mapping> 644 <mime-mapping> 645 <extension>java</extension> 646 <mime-type>text/plain</mime-type> 647 </mime-mapping> 648 <mime-mapping> 649 <extension>jnlp</extension> 650 <mime-type>application/x-java-jnlp-file</mime-type> 651 </mime-mapping> 652 <mime-mapping> 653 <extension>jpe</extension> 654 <mime-type>image/jpeg</mime-type> 655 </mime-mapping> 656 <mime-mapping> 657 <extension>jpeg</extension> 658 <mime-type>image/jpeg</mime-type> 659 </mime-mapping> 660 <mime-mapping> 661 <extension>jpg</extension> 662 <mime-type>image/jpeg</mime-type> 663 </mime-mapping> 664 <mime-mapping> 665 <extension>js</extension> 666 <mime-type>text/javascript</mime-type> 667 </mime-mapping> 668 <mime-mapping> 669 <extension>jsf</extension> 670 <mime-type>text/plain</mime-type> 671 </mime-mapping> 672 <mime-mapping> 673 <extension>jspf</extension> 674 <mime-type>text/plain</mime-type> 675 </mime-mapping> 676 <mime-mapping> 677 <extension>kar</extension> 678 <mime-type>audio/x-midi</mime-type> 679 </mime-mapping> 680 <mime-mapping> 681 <extension>latex</extension> 682 <mime-type>application/x-latex</mime-type> 683 </mime-mapping> 684 <mime-mapping> 685 <extension>m3u</extension> 686 <mime-type>audio/x-mpegurl</mime-type> 687 </mime-mapping> 688 <mime-mapping> 689 <extension>mac</extension> 690 <mime-type>image/x-macpaint</mime-type> 691 </mime-mapping> 692 <mime-mapping> 693 <extension>man</extension> 694 <mime-type>application/x-troff-man</mime-type> 695 </mime-mapping> 696 <mime-mapping> 697 <extension>mathml</extension> 698 <mime-type>application/mathml+xml</mime-type> 699 </mime-mapping> 700 <mime-mapping> 701 <extension>me</extension> 702 <mime-type>application/x-troff-me</mime-type> 703 </mime-mapping> 704 <mime-mapping> 705 <extension>mid</extension> 706 <mime-type>audio/x-midi</mime-type> 707 </mime-mapping> 708 <mime-mapping> 709 <extension>midi</extension> 710 <mime-type>audio/x-midi</mime-type> 711 </mime-mapping> 712 <mime-mapping> 713 <extension>mif</extension> 714 <mime-type>application/x-mif</mime-type> 715 </mime-mapping> 716 <mime-mapping> 717 <extension>mov</extension> 718 <mime-type>video/quicktime</mime-type> 719 </mime-mapping> 720 <mime-mapping> 721 <extension>movie</extension> 722 <mime-type>video/x-sgi-movie</mime-type> 723 </mime-mapping> 724 <mime-mapping> 725 <extension>mp1</extension> 726 <mime-type>audio/x-mpeg</mime-type> 727 </mime-mapping> 728 <mime-mapping> 729 <extension>mp2</extension> 730 <mime-type>audio/x-mpeg</mime-type> 731 </mime-mapping> 732 <mime-mapping> 733 <extension>mp3</extension> 734 <mime-type>audio/x-mpeg</mime-type> 735 </mime-mapping> 736 <mime-mapping> 737 <extension>mp4</extension> 738 <mime-type>video/mp4</mime-type> 739 </mime-mapping> 740 <mime-mapping> 741 <extension>mpa</extension> 742 <mime-type>audio/x-mpeg</mime-type> 743 </mime-mapping> 744 <mime-mapping> 745 <extension>mpe</extension> 746 <mime-type>video/mpeg</mime-type> 747 </mime-mapping> 748 <mime-mapping> 749 <extension>mpeg</extension> 750 <mime-type>video/mpeg</mime-type> 751 </mime-mapping> 752 <mime-mapping> 753 <extension>mpega</extension> 754 <mime-type>audio/x-mpeg</mime-type> 755 </mime-mapping> 756 <mime-mapping> 757 <extension>mpg</extension> 758 <mime-type>video/mpeg</mime-type> 759 </mime-mapping> 760 <mime-mapping> 761 <extension>mpv2</extension> 762 <mime-type>video/mpeg2</mime-type> 763 </mime-mapping> 764 <mime-mapping> 765 <extension>ms</extension> 766 <mime-type>application/x-wais-source</mime-type> 767 </mime-mapping> 768 <mime-mapping> 769 <extension>nc</extension> 770 <mime-type>application/x-netcdf</mime-type> 771 </mime-mapping> 772 <mime-mapping> 773 <extension>oda</extension> 774 <mime-type>application/oda</mime-type> 775 </mime-mapping> 776 <mime-mapping> 777 <!-- OpenDocument Database --> 778 <extension>odb</extension> 779 <mime-type>application/vnd.oasis.opendocument.database</mime-type> 780 </mime-mapping> 781 <mime-mapping> 782 <!-- OpenDocument Chart --> 783 <extension>odc</extension> 784 <mime-type>application/vnd.oasis.opendocument.chart</mime-type> 785 </mime-mapping> 786 <mime-mapping> 787 <!-- OpenDocument Formula --> 788 <extension>odf</extension> 789 <mime-type>application/vnd.oasis.opendocument.formula</mime-type> 790 </mime-mapping> 791 <mime-mapping> 792 <!-- OpenDocument Drawing --> 793 <extension>odg</extension> 794 <mime-type>application/vnd.oasis.opendocument.graphics</mime-type> 795 </mime-mapping> 796 <mime-mapping> 797 <!-- OpenDocument Image --> 798 <extension>odi</extension> 799 <mime-type>application/vnd.oasis.opendocument.image</mime-type> 800 </mime-mapping> 801 <mime-mapping> 802 <!-- OpenDocument Master Document --> 803 <extension>odm</extension> 804 <mime-type>application/vnd.oasis.opendocument.text-master</mime-type> 805 </mime-mapping> 806 <mime-mapping> 807 <!-- OpenDocument Presentation --> 808 <extension>odp</extension> 809 <mime-type>application/vnd.oasis.opendocument.presentation</mime-type> 810 </mime-mapping> 811 <mime-mapping> 812 <!-- OpenDocument Spreadsheet --> 813 <extension>ods</extension> 814 <mime-type>application/vnd.oasis.opendocument.spreadsheet</mime-type> 815 </mime-mapping> 816 <mime-mapping> 817 <!-- OpenDocument Text --> 818 <extension>odt</extension> 819 <mime-type>application/vnd.oasis.opendocument.text</mime-type> 820 </mime-mapping> 821 <mime-mapping> 822 <extension>ogg</extension> 823 <mime-type>application/ogg</mime-type> 824 </mime-mapping> 825 <mime-mapping> 826 <!-- OpenDocument Drawing Template --> 827 <extension>otg </extension> 828 <mime-type>application/vnd.oasis.opendocument.graphics-template</mime-type> 829 </mime-mapping> 830 <mime-mapping> 831 <!-- HTML Document Template --> 832 <extension>oth</extension> 833 <mime-type>application/vnd.oasis.opendocument.text-web</mime-type> 834 </mime-mapping> 835 <mime-mapping> 836 <!-- OpenDocument Presentation Template --> 837 <extension>otp</extension> 838 <mime-type>application/vnd.oasis.opendocument.presentation-template</mime-type> 839 </mime-mapping> 840 <mime-mapping> 841 <!-- OpenDocument Spreadsheet Template --> 842 <extension>ots</extension> 843 <mime-type>application/vnd.oasis.opendocument.spreadsheet-template </mime-type> 844 </mime-mapping> 845 <mime-mapping> 846 <!-- OpenDocument Text Template --> 847 <extension>ott</extension> 848 <mime-type>application/vnd.oasis.opendocument.text-template</mime-type> 849 </mime-mapping> 850 <mime-mapping> 851 <extension>pbm</extension> 852 <mime-type>image/x-portable-bitmap</mime-type> 853 </mime-mapping> 854 <mime-mapping> 855 <extension>pct</extension> 856 <mime-type>image/pict</mime-type> 857 </mime-mapping> 858 <mime-mapping> 859 <extension>pdf</extension> 860 <mime-type>application/pdf</mime-type> 861 </mime-mapping> 862 <mime-mapping> 863 <extension>pgm</extension> 864 <mime-type>image/x-portable-graymap</mime-type> 865 </mime-mapping> 866 <mime-mapping> 867 <extension>pic</extension> 868 <mime-type>image/pict</mime-type> 869 </mime-mapping> 870 <mime-mapping> 871 <extension>pict</extension> 872 <mime-type>image/pict</mime-type> 873 </mime-mapping> 874 <mime-mapping> 875 <extension>pls</extension> 876 <mime-type>audio/x-scpls</mime-type> 877 </mime-mapping> 878 <mime-mapping> 879 <extension>png</extension> 880 <mime-type>image/png</mime-type> 881 </mime-mapping> 882 <mime-mapping> 883 <extension>pnm</extension> 884 <mime-type>image/x-portable-anymap</mime-type> 885 </mime-mapping> 886 <mime-mapping> 887 <extension>pnt</extension> 888 <mime-type>image/x-macpaint</mime-type> 889 </mime-mapping> 890 <mime-mapping> 891 <extension>ppm</extension> 892 <mime-type>image/x-portable-pixmap</mime-type> 893 </mime-mapping> 894 <mime-mapping> 895 <extension>ppt</extension> 896 <mime-type>application/powerpoint</mime-type> 897 </mime-mapping> 898 <mime-mapping> 899 <extension>ps</extension> 900 <mime-type>application/postscript</mime-type> 901 </mime-mapping> 902 <mime-mapping> 903 <extension>psd</extension> 904 <mime-type>image/x-photoshop</mime-type> 905 </mime-mapping> 906 <mime-mapping> 907 <extension>qt</extension> 908 <mime-type>video/quicktime</mime-type> 909 </mime-mapping> 910 <mime-mapping> 911 <extension>qti</extension> 912 <mime-type>image/x-quicktime</mime-type> 913 </mime-mapping> 914 <mime-mapping> 915 <extension>qtif</extension> 916 <mime-type>image/x-quicktime</mime-type> 917 </mime-mapping> 918 <mime-mapping> 919 <extension>ras</extension> 920 <mime-type>image/x-cmu-raster</mime-type> 921 </mime-mapping> 922 <mime-mapping> 923 <extension>rdf</extension> 924 <mime-type>application/rdf+xml</mime-type> 925 </mime-mapping> 926 <mime-mapping> 927 <extension>rgb</extension> 928 <mime-type>image/x-rgb</mime-type> 929 </mime-mapping> 930 <mime-mapping> 931 <extension>rm</extension> 932 <mime-type>application/vnd.rn-realmedia</mime-type> 933 </mime-mapping> 934 <mime-mapping> 935 <extension>roff</extension> 936 <mime-type>application/x-troff</mime-type> 937 </mime-mapping> 938 <mime-mapping> 939 <extension>rtf</extension> 940 <mime-type>application/rtf</mime-type> 941 </mime-mapping> 942 <mime-mapping> 943 <extension>rtx</extension> 944 <mime-type>text/richtext</mime-type> 945 </mime-mapping> 946 <mime-mapping> 947 <extension>sh</extension> 948 <mime-type>application/x-sh</mime-type> 949 </mime-mapping> 950 <mime-mapping> 951 <extension>shar</extension> 952 <mime-type>application/x-shar</mime-type> 953 </mime-mapping> 954 <!-- 955 <mime-mapping> 956 <extension>shtml</extension> 957 <mime-type>text/x-server-parsed-html</mime-type> 958 </mime-mapping> 959 --> 960 <mime-mapping> 961 <extension>smf</extension> 962 <mime-type>audio/x-midi</mime-type> 963 </mime-mapping> 964 <mime-mapping> 965 <extension>sit</extension> 966 <mime-type>application/x-stuffit</mime-type> 967 </mime-mapping> 968 <mime-mapping> 969 <extension>snd</extension> 970 <mime-type>audio/basic</mime-type> 971 </mime-mapping> 972 <mime-mapping> 973 <extension>src</extension> 974 <mime-type>application/x-wais-source</mime-type> 975 </mime-mapping> 976 <mime-mapping> 977 <extension>sv4cpio</extension> 978 <mime-type>application/x-sv4cpio</mime-type> 979 </mime-mapping> 980 <mime-mapping> 981 <extension>sv4crc</extension> 982 <mime-type>application/x-sv4crc</mime-type> 983 </mime-mapping> 984 <mime-mapping> 985 <extension>swf</extension> 986 <mime-type>application/x-shockwave-flash</mime-type> 987 </mime-mapping> 988 <mime-mapping> 989 <extension>t</extension> 990 <mime-type>application/x-troff</mime-type> 991 </mime-mapping> 992 <mime-mapping> 993 <extension>tar</extension> 994 <mime-type>application/x-tar</mime-type> 995 </mime-mapping> 996 <mime-mapping> 997 <extension>tcl</extension> 998 <mime-type>application/x-tcl</mime-type> 999 </mime-mapping> 1000 <mime-mapping> 1001 <extension>tex</extension> 1002 <mime-type>application/x-tex</mime-type> 1003 </mime-mapping> 1004 <mime-mapping> 1005 <extension>texi</extension> 1006 <mime-type>application/x-texinfo</mime-type> 1007 </mime-mapping> 1008 <mime-mapping> 1009 <extension>texinfo</extension> 1010 <mime-type>application/x-texinfo</mime-type> 1011 </mime-mapping> 1012 <mime-mapping> 1013 <extension>tif</extension> 1014 <mime-type>image/tiff</mime-type> 1015 </mime-mapping> 1016 <mime-mapping> 1017 <extension>tiff</extension> 1018 <mime-type>image/tiff</mime-type> 1019 </mime-mapping> 1020 <mime-mapping> 1021 <extension>tr</extension> 1022 <mime-type>application/x-troff</mime-type> 1023 </mime-mapping> 1024 <mime-mapping> 1025 <extension>tsv</extension> 1026 <mime-type>text/tab-separated-values</mime-type> 1027 </mime-mapping> 1028 <mime-mapping> 1029 <extension>txt</extension> 1030 <mime-type>text/plain</mime-type> 1031 </mime-mapping> 1032 <mime-mapping> 1033 <extension>ulw</extension> 1034 <mime-type>audio/basic</mime-type> 1035 </mime-mapping> 1036 <mime-mapping> 1037 <extension>ustar</extension> 1038 <mime-type>application/x-ustar</mime-type> 1039 </mime-mapping> 1040 <mime-mapping> 1041 <extension>vxml</extension> 1042 <mime-type>application/voicexml+xml</mime-type> 1043 </mime-mapping> 1044 <mime-mapping> 1045 <extension>xbm</extension> 1046 <mime-type>image/x-xbitmap</mime-type> 1047 </mime-mapping> 1048 <mime-mapping> 1049 <extension>xht</extension> 1050 <mime-type>application/xhtml+xml</mime-type> 1051 </mime-mapping> 1052 <mime-mapping> 1053 <extension>xhtml</extension> 1054 <mime-type>application/xhtml+xml</mime-type> 1055 </mime-mapping> 1056 <mime-mapping> 1057 <extension>xml</extension> 1058 <mime-type>application/xml</mime-type> 1059 </mime-mapping> 1060 <mime-mapping> 1061 <extension>xpm</extension> 1062 <mime-type>image/x-xpixmap</mime-type> 1063 </mime-mapping> 1064 <mime-mapping> 1065 <extension>xsl</extension> 1066 <mime-type>application/xml</mime-type> 1067 </mime-mapping> 1068 <mime-mapping> 1069 <extension>xslt</extension> 1070 <mime-type>application/xslt+xml</mime-type> 1071 </mime-mapping> 1072 <mime-mapping> 1073 <extension>xul</extension> 1074 <mime-type>application/vnd.mozilla.xul+xml</mime-type> 1075 </mime-mapping> 1076 <mime-mapping> 1077 <extension>xwd</extension> 1078 <mime-type>image/x-xwindowdump</mime-type> 1079 </mime-mapping> 1080 <mime-mapping> 1081 <extension>wav</extension> 1082 <mime-type>audio/x-wav</mime-type> 1083 </mime-mapping> 1084 <mime-mapping> 1085 <extension>svg</extension> 1086 <mime-type>image/svg+xml</mime-type> 1087 </mime-mapping> 1088 <mime-mapping> 1089 <extension>svgz</extension> 1090 <mime-type>image/svg+xml</mime-type> 1091 </mime-mapping> 1092 <mime-mapping> 1093 <extension>vsd</extension> 1094 <mime-type>application/x-visio</mime-type> 1095 </mime-mapping> 1096 <mime-mapping> 1097 <!-- Wireless Bitmap --> 1098 <extension>wbmp</extension> 1099 <mime-type>image/vnd.wap.wbmp</mime-type> 1100 </mime-mapping> 1101 <mime-mapping> 1102 <!-- WML Source --> 1103 <extension>wml</extension> 1104 <mime-type>text/vnd.wap.wml</mime-type> 1105 </mime-mapping> 1106 <mime-mapping> 1107 <!-- Compiled WML --> 1108 <extension>wmlc</extension> 1109 <mime-type>application/vnd.wap.wmlc</mime-type> 1110 </mime-mapping> 1111 <mime-mapping> 1112 <!-- WML Script Source --> 1113 <extension>wmls</extension> 1114 <mime-type>text/vnd.wap.wmlscript</mime-type> 1115 </mime-mapping> 1116 <mime-mapping> 1117 <!-- Compiled WML Script --> 1118 <extension>wmlscriptc</extension> 1119 <mime-type>application/vnd.wap.wmlscriptc</mime-type> 1120 </mime-mapping> 1121 <mime-mapping> 1122 <extension>wmv</extension> 1123 <mime-type>video/x-ms-wmv</mime-type> 1124 </mime-mapping> 1125 <mime-mapping> 1126 <extension>wrl</extension> 1127 <mime-type>x-world/x-vrml</mime-type> 1128 </mime-mapping> 1129 <mime-mapping> 1130 <extension>Z</extension> 1131 <mime-type>application/x-compress</mime-type> 1132 </mime-mapping> 1133 <mime-mapping> 1134 <extension>z</extension> 1135 <mime-type>application/x-compress</mime-type> 1136 </mime-mapping> 1137 <mime-mapping> 1138 <extension>zip</extension> 1139 <mime-type>application/zip</mime-type> 1140 </mime-mapping> 1141 <mime-mapping> 1142 <extension>xls</extension> 1143 <mime-type>application/vnd.ms-excel</mime-type> 1144 </mime-mapping> 1145 <mime-mapping> 1146 <extension>doc</extension> 1147 <mime-type>application/vnd.ms-word</mime-type> 1148 </mime-mapping> 1149 <mime-mapping> 1150 <extension>ppt</extension> 1151 <mime-type>application/vnd.ms-powerpoint</mime-type> 1152 </mime-mapping> 1153 1154 <!-- ==================== Default Welcome File List ===================== --> 1155 <!-- When a request URI refers to a directory, the default servlet looks --> 1156 <!-- for a "welcome file" within that directory and, if present, --> 1157 <!-- to the corresponding resource URI for display. If no welcome file --> 1158 <!-- is present, the default servlet either serves a directory listing, --> 1159 <!-- or returns a 404 status, depending on how it is configured. --> 1160 <!-- --> 1161 <!-- If you define welcome files in your own application's web.xml --> 1162 <!-- deployment descriptor, that list *replaces* the list configured --> 1163 <!-- here, so be sure that you include any of the default values that --> 1164 <!-- you wish to include. --> 1165 1166 <welcome-file-list> 1167 <welcome-file>index.html</welcome-file> 1168 <welcome-file>index.htm</welcome-file> 1169 <welcome-file>index.jsp</welcome-file> 1170 </welcome-file-list> 1171 1172 </web-app>