第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么我輸入指定的用戶名和密碼后,總是無法跳轉(zhuǎn)到登錄成功的頁面,只能到登錄失敗的頁面?

代碼如下:

login.jsp

<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>

<%

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>

? ? <base href="<%=basePath%>">

? ??

? ? <title>My JSP 'login.jsp' starting page</title>

? ??

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="cache-control" content="no-cache">

<meta http-equiv="expires" content="0"> ? ?

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

<meta http-equiv="description" content="This is my page">

<!--

<link rel="stylesheet" type="text/css" href="styles.css">

-->


? </head>

??

? <body>

? ? <div id="container">

? ? <div class="logo">

? ? <a href="#"><img src="assets/logo.png" alt=""></a>

? ? </div>

? ? <div id="box">

? ? <form action="dologin.jsp" method="post">

? ? <p class="main">

? ? <label>用戶名:</label>

? ? <input name="uername" value="">

? ? <label>密碼:</label>

? ? <input name="password" type="password" value="">

? ? </p>

? ? <p class="space">

? ? <input type="submit" value="登錄" class="login" style="cursor:pointer; ">

? ? </p>

? ? </form>

? ? </div>

? ? </div>

? </body>

</html>


dologin.jsp

<%@

?page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>

<%

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

?//username=request.getAttribute("username").toString();

?//password=request.getAttribute("password").toString();

?

?//如果用戶名和密碼都等于admin,則登錄成功

?if("abc".equals(username)&&"12345".equals(password))

?{

? request.getRequestDispatcher("login_success.jsp").forward(request,response);

?

?}

?else

?{

? response.sendRedirect("login_failure.jsp");

?}

%>


login_success.jsp

<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>

<%

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>

? ? <base href="<%=basePath%>">

? ??

? ? <title>My JSP 'login.jsp' starting page</title>

? ??

<%--

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="cache-control" content="no-cache">

<meta http-equiv="expires" content="0"> ? ?

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

<meta http-equiv="description" content="This is my page">

--%>

<link type="text/css" href="css/login.css" rel="stylesheet"/>

<link type="text/css" href="css/smoothness/jquery-ui-1.7.2.custom.html" rel=""/>

<script type="text/javascript" src="js/jquery 1.3.2.min.js"></script>

<script type="text/javascript" src="js/easyTooltip.js"></script>

<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>

<!--

<link rel="stylesheet" type="text/css" href="styles.css">

-->


? </head>

??

? <body>

? ? <div id="container">

? ? <div class="logo">

? ? <a href="#"><img src="assets/logo.png"></a>

? ? </div>

? ? <div id="box">

? ? 歡迎您XXX,登錄成功!

? ? <%--<font color="red"> --%>

? ? </div>

? ? </div>

? </body>

</html>



login_failure.jsp

<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>

<%

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>

? ? <base href="<%=basePath%>">

? ??

? ? <title>My JSP 'login.jsp' starting page</title>

? ??

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="cache-control" content="no-cache">

<meta http-equiv="expires" content="0"> ? ?

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

<meta http-equiv="description" content="This is my page">

<!--

<link rel="stylesheet" type="text/css" href="styles.css">

-->


? </head>

??

? <body>

? ? <div id="container">

? ? <div class="logo">

? ? <a href="#"><img src="assets/logo.png"></a>

? ? </div>

? ? <div id="box">

? ? 登錄失??!請檢查用戶名或者密碼!<br>

? ? <a href="login.jsp">返回登錄</a>

? ?

? ? </div>

? ? </div>

? </body>

</html>


正在回答

3 回答

你的input的username寫錯了 ? 不是urename

0 回復(fù) 有任何疑惑可以回復(fù)我~

是不是不輸用戶名就會報錯?記得加驗證。

0 回復(fù) 有任何疑惑可以回復(fù)我~

為何不out.write一下你獲取到的username和password呢

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

為什么我輸入指定的用戶名和密碼后,總是無法跳轉(zhuǎn)到登錄成功的頁面,只能到登錄失敗的頁面?

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號