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