JSP authentication method using servlet filter
This paper describes the method of JSP authentication using servlet filter. Share with you for your reference, as follows:
1. Function description of servlet filter
(1) Intercept the HttpServletRequest of the client before the HttpServletRequest arrives at the servlet. Check the HttpServletRequest as needed, or modify the HttpServletRequest header and data. (2) intercept the httpservletresponse before the httpservletresponse arrives at the client. Check the httpservletresponse as needed, and modify the httpservletresponse header and data.
2. Apply servlet filter for authentication
Assume login1.0 in the root directory of the website htm、longin1. JSP is used for user login, and the files in Chap08 directory can only be accessed after user login.
(1) Writing servlet filters
(2) Configure web.xml
(3) Login1.htm code
(4) Login1.jsp code
I hope this article will help you in JSP programming.