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");

}

%>


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部