Java login Cookie, java login cookie

Source: Internet
Author: User

Java login Cookie, java login cookie

There are two types of static pages: jsp and html.

First look at the jsp

Add the input tag whose type is checkbox to the login form

Add a click event for the checkbox

Determine whether to set the Cookie Based on the remember value in the background logon Method

After the page is loaded, obtain the Cookie and save it to pageContext.

In js Code, determine whether the username and password in pageContext are empty. If not, enter a value in the corresponding input box and set the checkbox of remember to the selected status.

The main html operations are the same as above, except that the java code cannot be embedded in the (jsp) display code, and there is no built-in jsp object. Therefore, the Cookie is obtained in the request to initiate the login page.

 

Page display can be selected through the if judgment Statement of freemarker

 

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.