target:
l Master the general processing process after login;
l Ability to add security control to each page;
l can share authentication code;
L use filters to authenticate permissions;
l is able to authenticate local content of the file;
l Master the basic implementation of security verification code; the
l enhances security through exception handling.
main content:
l by modifying the previous login feature, Handle logins for both administrators and ordinary users;
l Add control for pages that administrators can access; The
l shares control code in each page, uses specialized files, and then calls when needed;
L use filters to reduce duplicate validation code;
l Through the standard tag library to complete the page local Information security control; the
l describes the basic implementation of the security authentication Code;
1, perfect login
Normally, the administrator login succeeds and then jumps to the admin default UI, and the normal user is logged in to the default working interface. , user login failed, jump to login interface and log in again.
to complete this function, you need to write an administrator interface and a common user interface. The file for the
admin Interface is manager.jsp, and the code is as follows:
----------------------------- Code manager.jsp----------------------------------
<%@ page contenttype= "text/html;charset= gb2312 "%>
Administrator Action interface
--------------------------------------------------------- The file that corresponds to the
Normal user interface----------------------------is commonuser.jsp, and the code is as follows:
----------------- ------------code commonuser.jsp----------------------------