課程
/后端開發
/Java
/JAVA遇見HTML——JSP篇
2014-11-11
源自:JAVA遇見HTML——JSP篇 6-4
正在回答
<%@?page?language="java"?contentType="text/html;?charset=utf-8" import="java.net.*" ????pageEncoding="utf-8"%> <!DOCTYPE?html?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN"?"http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"> <title>用戶登錄</title> </head> <body> <h1>用戶登錄</h1> <hr> <% request.setCharacterEncoding("utf-8"); String?username?=?""; String?password?=?""; Cookie[]?cookies?=?request.getCookies(); if(cookies!=null?&&?cookies.length>0){ for(Cookie?c:cookies){ if(c.getName().equals("username")){ username?=?URLDecoder.decode(c.getValue(),"utf-8"); } if(c.getName().equals("password")){ password?=?URLDecoder.decode(c.getValue(),"utf-8"); } } } %> <form?name="loginForm"?action="doLogin.jsp"?method="post"> <table> <tr> <td>username</td> <td><input?type="text"?name="username"?value=<%=username%>></input></td> </tr> <tr> <td>password</td> <td><input?type="password"?name="password"?value=<%=password%>></input></td> </tr> <tr> <td> <input?type="checkbox"?name="isUseCookie"?checked="true"/>記住登錄狀態 </td> </tr> <tr> <td?colspan="2"?align="center"><input?type="submit"?value="submit"/></td> </tr> </table> </form> </body> </html>
<form action="dologin.jsp" name="用戶信息登錄" method="post">
<table>
<tr>
<td>用戶名:</td>
<td><input type="text" name="username"></td>
</tr>
<td>密碼:</td>
<td><input type="password" name="password"></td>
<td colspan="2"><input type="checkbox" name="isUseCookie" checked="checked" />十天內記住我的登錄狀態</td>
<td colspan="2" align="center"><input type="submit" value="登錄"><input type="reset" value="取消"></td>
</table>
</form>
表單中應該是這些~后面有一個頁面有這些東西的答案~其實 你還可以 直接下載 老師的代碼。。。
我想了一會兒,猜出了代碼,謝謝。。<form name="loginForm" action="dologin.jsp"method="post"/><table>?? <tr>?? <td>用戶名:</td>?? </tr>?? <tr>??? <td><input name="username"type="text"value=""/></td>??? </tr>?? <tr>?? <td>密碼:</td>?? </tr>?? <tr>?? <td><input name="password"type="password"value=""/></td>?? </tr>?? <tr>?? <td? colspan="2"><input type="checkbox"name="isUserCookie" checked="checked">10天內記住我的登錄狀態</td>?? </tr>?? <tr>?? <td? colspan="2"align="center">? <input type="submit"value="登錄"/><input type="reset" value="取消"/>?? </tr></table>??
舉報
Java Web入門級教程JSP,帶你輕松的學習JSP基礎知識
3 回答靜態內容指的是什么?
2 回答10天內記住我的登錄狀態
2 回答動態和靜態網頁
1 回答靜態網頁和動態網頁
1 回答靜態和動態網頁的區別
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2015-03-23
<%@?page?language="java"?contentType="text/html;?charset=utf-8" import="java.net.*" ????pageEncoding="utf-8"%> <!DOCTYPE?html?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN"?"http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"> <title>用戶登錄</title> </head> <body> <h1>用戶登錄</h1> <hr> <% request.setCharacterEncoding("utf-8"); String?username?=?""; String?password?=?""; Cookie[]?cookies?=?request.getCookies(); if(cookies!=null?&&?cookies.length>0){ for(Cookie?c:cookies){ if(c.getName().equals("username")){ username?=?URLDecoder.decode(c.getValue(),"utf-8"); } if(c.getName().equals("password")){ password?=?URLDecoder.decode(c.getValue(),"utf-8"); } } } %> <form?name="loginForm"?action="doLogin.jsp"?method="post"> <table> <tr> <td>username</td> <td><input?type="text"?name="username"?value=<%=username%>></input></td> </tr> <tr> <td>password</td> <td><input?type="password"?name="password"?value=<%=password%>></input></td> </tr> <tr> <td> <input?type="checkbox"?name="isUseCookie"?checked="true"/>記住登錄狀態 </td> </tr> <tr> <td?colspan="2"?align="center"><input?type="submit"?value="submit"/></td> </tr> </table> </form> </body> </html>2014-12-03
<form action="dologin.jsp" name="用戶信息登錄" method="post">
<table>
<tr>
<td>用戶名:</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>密碼:</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td colspan="2"><input type="checkbox" name="isUseCookie" checked="checked" />十天內記住我的登錄狀態</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="登錄"><input type="reset" value="取消"></td>
</tr>
</table>
</form>
表單中應該是這些~后面有一個頁面有這些東西的答案~其實 你還可以 直接下載 老師的代碼。。。
2014-11-11
我想了一會兒,猜出了代碼,謝謝。。<form name="loginForm" action="dologin.jsp"method="post"/>
<table>
?? <tr>
?? <td>用戶名:</td>
?? </tr>
?? <tr>
??? <td><input name="username"type="text"value=""/></td>
??? </tr>
?? <tr>
?? <td>密碼:</td>
?? </tr>
?? <tr>
?? <td><input name="password"type="password"value=""/></td>
?? </tr>
?? <tr>
?? <td? colspan="2"><input type="checkbox"name="isUserCookie" checked="checked">10天內記住我的登錄狀態</td>
?? </tr>
?? <tr>
?? <td? colspan="2"align="center">? <input type="submit"value="登錄"/><input type="reset" value="取消"/>
?? </tr>
</table>
??