Web. XML (7) _mime-mapping, Welcome-file-list, Error-page

Source: Internet
Author: User

10.mime-mapping:mime-mapping includes two child elements extension and Mime-type. Defines an extension and a MIME type to do the mapping.
MIME (Multipurpose Internet Mail Extensions) Multipurpose Internet Mail Extension type is the type of file that is set up with an extension that is opened by an application,
When the extension file is visited, the browser will open it on its own initiative using the specified application. Used to specify some of the client's own defined file names, as well as some ways to open media files

After the browser receives the file, it goes into the plug-in system to find out which plug-in is able to recognize the read received file.
Assuming that the browser does not know which plug-in system to invoke, it may tell the user that a plugin is missing, or directly select an existing plug-in to attempt to read the received file, which can cause a system crash.
The absence of a MIME identity in the transmitted information can be very difficult to anticipate, and some computers may crash because some computer systems may not fail.

<!--mime-mapping includes two child elements extension and mime-type. Define an extension and a MIME type to do the mapping . --> 
     <mime-mapping> 
        <!--extension name  --> 
        <extension>htm</extension> 
         <!--MIME format  --> 
        <mime-type>text/html</mime-type> 
    </mime-mapping> 

11.welcom-file-list: Indicates which file the server uses when it receives a URL that references a folder name instead of a file name.
<welcome-file-list>
Welcome-file-list includes a child element welcome-file. Used to define the first page list.
<welcome-file> used to specify the home name </welcome-flie>
Welcome-file is used to specify the home page name. We can use <welcome-file> to specify a few home pages, The server will find the first page in the set order.
Example:
<welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
  < Welcome-file>index.htm</welcome-file>
</welcome-file-list>

12.error-page: Allows you to make a page that will be displayed when a specific HTTP status code is returned, or when a particular type of exception is thrown.
The Error-page element consists of three sub-elements error-code,exception-type and location. The type of error code or exception (exception) is appropriate
To the Web platform resource path.
<error-code> Error Codes </error-code>
HTTP Error Code, for example: 404
<exception-type>Exception</exception-type>
A full-name Java exception type
<location>/Path </location>
Related resource paths within the Web platform
</error-page>
Example:
<error-page>
<error-code>404</error-code>
<location>/error404.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/except.jsp</location>
</error-page>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.