java按钮点击无反应_登录按钮按了没反应

//页面显示没有问题,就是登录,注册按钮按了没反应

//这是登录页面代码

%>

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

登陆

          

    User Login 

//其实我在想是不是我form标签放的位置错了,但是试了几个位置都不行

                  

                  

@Copyright 2016.3-2016.4 韶关学院丁香苑G103 粤ICP41965262

//这是doLogin页面代码 ,为了方便测试我直接用的老师的代码应该排除了这部分出错

%>

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("index.jsp").forward(request, response);

}

else

{

response.sendRedirect("LoginFailure.jsp");

}

%>

本文链接:https://my.lmcjl.com/post/13100.html

展开阅读全文

4 评论

留下您的评论.