Custom 404 Pages
Recently, in dealing with security vulnerabilities, found that the root, manager, example and so on under Tomcat have no security mechanism, so it was deleted, but access to the Localhost:8080/example test will be a sudden leakage of Tomcat basic information, Although the content is not many but still want to give 404 page hint, the concrete modification method is relatively simple.
Add the following code to the Conf/server.xml
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
Configuration is complete, but this 404 page needs to be defined by itself and where the file is placed. In fact, when the visit to localhost:8080/after the kitten remember, is the root file under the content, we do not delete the root folder, the 404.html page into the root folder can be in the test access localhost:8080/example You will find that you will jump to our custom 404.html. Customizing the default access page
Or the cat, how to access localhost:8080 doesn't appear on that cat's welcome page, likewise, in conf/ Server.xml file settings, where welcome-file in order to load, where you want to load the default page can be, base.html is the default I want to load the file replaced the original index.jsp file
<welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> welcome-file>base.html</welcome-file> </welcome-f Ile-list>