Cookie cookies[]=request.getCookies();
Cookie stCookie=null;
String password=null;
String passwordvalue=null;
String usernamevalue=null;
String cookiename = null;
String nameandpassword[]=new String[3];
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
stCookie = cookies[i];
cookiename = stCookie.getName();
if (cookiename!=null && cookiename.equalsIgnoreCase("db_password")) {
passwordvalue = stCookie.getValue();
password = passwordvalue;//.substring(8, passwordvalue.length()-3);
nameandpassword[1] = password.trim();
}
if (cookiename!=null && cookiename.equalsIgnoreCase("db_username")) {
usernamevalue = stCookie.getValue();
nameandpassword[0] = usernamevalue.trim();
}
}
}
用户名 / 邮箱:
value="" />
密码:
" name="Password" id="Password" />
posted on 2013-11-01 15:08 wyx 阅读(227) 评论(0) 编辑 收藏