Objectives:
L master the general process after logon;
L added security control for each page;
L ability to share verification code;
L use the filter to verify the permission;
L ability to verify the local content of the file;
L master the basic implementation methods of security verification codes;
L enhance security through exception handling.
Main content:
L modify the previous logon function to process the logon of administrators and normal users respectively;
L add control for pages accessible by administrators;
L share the control code on each page, use special files, and then call them as needed;
L use a filter to reduce repeated verification code;
L security control of partial page information through the standard tag library;
L describes the basic implementation of the security verification code;
1. Improve the logon Function
Under normal circumstances, after successful logon, the Administrator's default work interface is displayed. After logon, a common user jumps to the default work interface of a common user. After a user fails to log on, the Administrator jumps to the logon interface to log on again.
To complete this function, you need to write the administrator interface and common user interface.
The file corresponding to the administrator interface is manager. jsp. The Code is as follows:
----------------------------- Code manager. jsp ----------------------------------
<% @ Page contentType = "text/html; charset = gb2312" %>
Administrator operation interface
Bytes -------------------------------------------------------------------------------------
The file corresponding to the common user interface is commonuser. jsp. The Code is as follows:
----------------------------- Code commonuser. jsp ----------------------------