cookie实现自动登陆(2)

下面的是对CookieUtil工具类各方法的调用演示:

User.java

封装用户信息的JavaBean对象模型

package com.itcast.bean;

public class User {

       private int id;

      

       private String userName;

       private String password;

      

       public String getPassword() {

              return password;

       }

       public void setPassword(String password) {

              this.password = password;

       }

       public String getUserName() {

              return userName;

       }

       public void setUserName(String userName) {

              this.userName = userName;

       }

       public int getId() {

              return id;

       }

       public void setId(int id) {

              this.id = id;

       }

}

你可能感兴趣的:(登录,cookie,自动登录)