73 forward动作
生活随笔
收集整理的這篇文章主要介紹了
73 forward动作
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
定義一個logind的jsp頁面
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%><!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Insert title here</title> </head> <body> <h1>用戶登錄</h1> <hr> <form action="forward.jsp" name="loginForm" 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="submit" value="登錄"></td> </tr> </table> </body> </html>定義一個forward
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="pragma" content="no-cache"> <title>Insert title here</title> </head> <body> <h1>forward 動作</h1> <jsp:forward page="user.jsp"/> </body> </html>定義一個user
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%> <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Insert title here</title> </head> <body> <h1>用戶資料</h1> <% String username=""; String password = ""; if(request.getParameter("username")!=null){username = request.getParameter("username"); } if(request.getParameter("password")!=null){username = request.getParameter("password"); } %> 用戶名:<%=username %> 密碼:<%=password %>> </body> </html>運行結果
總結
以上是生活随笔為你收集整理的73 forward动作的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 课外拓展
- 下一篇: WIFI无线网络技术详细分析