A servlet was customized
1. First we write in Web. xml
And then start the project we open http://localhost:8080 this time we can forward index.jsp through the servlet,
Then I changed the servlet inside index.jsp to index.html, then the error, and then the cycle of death,
Then I changed the Web. XML to/* so that direct access no matter whether the servlet is index.jsp or index.html is a dead loop.
Then understand/and/* intercept for the requested request, but/for the. JSP does not intercept. For why the JSP does not intercept, this should be inside the Web container control. And then looked at Tomcat's web. XML configuration file
Inside, he has 1 default servlets,
。
And then how do we get him to visit the Web. XML if we write/* This, then we'll write
That's all you can do.
Then we don't care whether/or/*, we want to access the static page, then we write this in Web. XML, and then forward the time can be the static page, do not go servlet, when forwarding remember to write absolute path OH
Servlet-mapping Url-pattern/and/* differences