jsp数据库开发实例精粹全书原代码
无解压缩密码
包括 书店
源代码在线查看: login.jsp
String mesg = "";
if( request.getParameter("username")!=null && !request.getParameter("username").equals("")){
String username =request.getParameter("username");
String passwd = request.getParameter("passwd");
username = new String(username.getBytes("ISO8859-1"));
passwd = new String(passwd.getBytes("ISO8859-1"));
login.setUsername(username);
login.setPasswd(passwd);
out.print(username+passwd);
if (login.excute()){
session.setAttribute("username",username);
String userid = Long.toString(login.getUserid());
session.setAttribute("userid",userid);
response.sendRedirect("booklist.jsp");
%>
}else {
mesg = "登录出错!" ;
}
}
%>
function checkform() {
if (document.form1.username.value=="" || document.form1.passwd.value==""){
alert("用户名或密码为空!");
return false;
}
return true;
}
用户登录
out.println("" + mesg + "");}%>
用户名:
密码:
测试用户:wxy 密码:wxy
如果你还不是本站用户,请在此注册