doLogin.jsp
<jsp:useBean id="myUser" class="lly.login.entity.User" scope="session" />
<jsp:useBean id="myUserDao" class="lly.login.dao.UserDao"
scope="session" />
<jsp:setProperty property="*" name="myUser" />
<%
out.println("!");
boolean flag = myUserDao.check(myUser);
out.println(flag);
if (flag) {
session.setAttribute("myUser", myUser.getUsername());
request.getRequestDispatcher("login_success.jsp").forward(request, response);
} else {
response.sendRedirect("login_failure.jsp");
}
%>
login_success.jsp
<%
String myUser = "";
if(session.getAttribute("myUser")!=null){
myUser =(String)session.getAttribute("myUser");
}
%>
欢迎您:<font color="red"><%=myUser %></font>登陆成功!
type Exception report
message An exception occurred processing JSP page /doLogin.jsp at line 10
description The server encountered an internal error that prevented it from fulfilling this request.