Processing of welcome-file-list
According to the Servlet specification, the welcome file is a part of the URI that does not start with a slash (/), but I do not know whether it can be a file or a URL mapped to a Servlet, such
1. if the welcome file refers to index.html, index.htm, index. jsp (the preferred choice for SUN Enterprise applications), you need to find whether the file system exists in the file system. If it does NOT exist, the 404 (not found) error code will be returned to the client; otherwise, the file will be processed.
2. If the index. do file is welcome and all *. do operations are mapped to ActionServlet processing, will the container accept such requests?
Through the tomcat (a good JSP running platform) 4.1 test, we found that
In the second case, the container Returns Error 404, even if index. do is correctly mapped, it can be correctly processed by the corresponding Servlet. If an index. do file is placed in the corresponding directory, index. do is correctly processed.
So the processing method of tomcat (a very useful JSP running platform) should be
1. test whether the index. do file exists. If it does not exist, find another welcome file.
2. If yes, return the redirection information (including the complete URL of the welcome file) to the client.
Note: The redirection method must be adopted and cannot be directly handed over to the Servlet for processing. If it is directly handed over to the Servlet for processing, although the correct information can be returned to the browser, however, if the HTML code contains a reference to a relative path URL, it will be incorrectly interpreted by the browser. Therefore, the browser must be told the correct URL. redirection is a safe method.