利用jsp做一个登陆
我刚学JSP现在想做一个登陆
在dologin.jsp里面获得login.jsp传过来的参数,然后调用dao层的login()方法
login()方法的返回值是一个list 泛型是用户实体类
现在我应该怎么处理这个list才能实现登陆跳转?
<%
String name=request.getParameter("username") ;
String pwd=request.getParameter("userpwd");
UserInfos us=new UserInfos();
us.setLoginName(name);
us.setLoginPwd(pwd);
IUserDao udao = new UserDaoImpl();
List<UserInfos> list=udao.login(us);
if(list!=null){
request.getRequestDispatcher("ok.jsp").forward(request,response);
}else{
request.getRequestDispatcher("login.jsp").forward(request,response);
}
%>
现在错误是
HTTP Status 500 - Unable to compile class for JSP:
type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 29 in the jsp file: /dologin.jsp
The method login(UserInfos) is undefined for the type IUserDao
26: us.setLoginName(name);
27: us.setLoginPwd(pwd);
28: IUserDao udao = new UserDaoImpl();
29: List<UserInfos> list=udao.login(us);
30: if(list!=null){
31: request.getRequestDispatcher("ok.jsp").forward(request,response);
32: }else{
我的login方法在本地实测是没有问题的