为什么跳转不到login_success.jsp页面?
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String username="";
String password="";
request.setCharacterEncoding("UTF-8");
username=request.getParameter("username");
password=request.getParameter("password");
//如果用户名和密码都等于admin,则登录成功;
if("admin".equals(username) && "admin".equals(password))
{
session.setAttribute("loginUser",username);
request.getRequestDispatcher("login_success.jsp").forward(request, response);
}else{
response.sendRedirect("login_failure.jsp");//如果登录名或密码错误,则登录失败;
}
%>