Security control in the Java Web

Source: Internet
Author: User


 
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----------------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.