请高手指教 jsp登录问题
程序代码:
Login.jsp <%@ page language="java" import="java.util.*" pageEncoding="GB18030"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> <form action="Loginaction.jsp" method="post"> 用户名:<input type="text" name="username"><br> 密码:<input type="password" name="pwd"><br> 教师:<input type="radio" name="flag" value="manager"> 学生:<input type="radio" name="flag" value="user"><br> <input type="submit" value="提交"> </form> <a href="Register.jsp">注册</a> </body> </html> Loginaction.jsp <%@ page language="java" import="java.util.*" pageEncoding="GB18030"%> <%@ page import="java.sql.*" %> <%@ page import="DB.UtilDb" %> <%@ page import="beans.User"%> <%@ page import="DAO.isLogin"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <% String username=request.getParameter("username"); String pwd=request.getParameter("pwd"); String Loginflag=request.getParameter("flag"); System.out.print(Loginflag); if((!Loginflag.equalsIgnoreCase("user"))&&(!Loginflag.equalsIgnoreCase("manager"))) { out.print("请选择登录对象"); out.println("<meta http-equiv='refresh' content='2;url=Login.jsp'> "); } User use=new User(); use.setUsername(username); use.setPwd(pwd); if(isLogin.Login(use,Loginflag)) { session.setAttribute("admin",Loginflag); out.print("登录成功"); out.println("<meta http-equiv='refresh' content='2;url=Main.jsp'> "); } else { out.print("用户名或者密码错误"); out.println("<meta http-equiv='refresh' content='2;url=Login.jsp'> "); } %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Loginaction.jsp</title> </head> <body> <br> </body> </html>loginaction 老是提示错误 if((!Loginflag.equalsIgnoreCase("user"))&&(!Loginflag.equalsIgnoreCase("manager")))
请高手指教