jsp登陆记住账号密码

蓝色是保存cookie保存密码账号
红色是读取回显密码账号

<%@ page contentType=“text/html; charset=utf-8” language=“java” import=“java.sql.*” errorPage="" %>

<!doctype html>

流程管控系统v1.0

<%

String username = “”;

String password = “”;

String s;

Cookie [] cookies =request.getCookies();

for (Cookie cookie:cookies) {

s=cookie.getName(); //通过getName方法获得cookie的名称

if (s.equals(“username”)) {

if (cookie.getValue()!=null) {

username=username+cookie.getValue(); //通过getValue方法获得cookie的值

}} else if (s.equals(“password”)) {

if (cookie.getValue()!=null) {

password=password+cookie.getValue();

}}}

%>

test

<input name=“yhm” value="<%=username %>" style=" background:url(…/img/user.jpg) no-repeat 0 0;

background-position: 10px 5px;padding-left: 60px;font-size: 18px;" type=“text”>



<input name=“pas” value="<%=password %>" style=" background:url(…/img/pass.jpg) no-repeat 0 0;

background-position: 10px 5px;padding-left: 60px;font-size: 18px;" type=“password”>



<input style=“width: 20px; height: 20px; vertical-align: middle; margin-top: -5px;”

type=“checkbox” id=“rember”>记住用户名和密码


  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值