隨筆 - 117  文章 - 72  trackbacks - 0

          聲明:原創(chuàng)作品(標(biāo)有[原]字樣)轉(zhuǎn)載時請注明出處,謝謝。

          常用鏈接

          常用設(shè)置
          常用軟件
          常用命令
           

          訂閱

          訂閱

          留言簿(7)

          隨筆分類(130)

          隨筆檔案(123)

          搜索

          •  

          積分與排名

          • 積分 - 156283
          • 排名 - 390

          最新評論

          《JSP完全學(xué)習(xí)手冊》學(xué)習(xí)心得:jsp:forward

          Judgment.jsp:
          <%@ page contentType="text/html; charset=gb2312" language="java"%>
          <html>
          <head>
          </head>
          <body>
          <%
            String User=request.getParameter("User");
            String Password=request.getParameter("Password");
            if(User.equals("Admin") && Password.equals("Admin")) { %>
               <jsp:forward page="welcome.jsp"/>
            <% }
            else
            { %>
              <jsp:forward page="Login.html"/>
            <% } %>
          </body>
          </html>
          welcome.jsp
          <%@ page contentType="text/html; charset=gb2312" %>
          <html>
          <head>
          <title>Forward動作示例</title>
          </head>
          <body>
          <center><h2>登錄成功</h2>
          <p>歡迎
          <% String User=request.getParameter("User");
           out.print(User);

           %>
          </p>
          </body>
          </html>
          Login.jsp:
          <html>
          <head>
          <title>登錄信息</title>
          </head>
          <body>
          <form action="Judgment.jsp" method="post" name="Loginfrm" id="Loginfrm">
            <table width="298"  border="0" align="center" cellpadding="2" cellspacing="1">
              <tr>
                <td align="right">用戶名:</td>
                <td align="left"><input name="User" type="text"  size="28"></td>
              </tr>
              <tr>
                <td  align="right">密 碼:</td>
                <td align="left"><input name="Password" type="password" size="30"></td>
              </tr>
              <tr>
                <td colspan="2" align="center"><input type="submit" value="登錄">
                  &nbsp;
                <input type="reset"  value="取消"></td>
              </tr>
            </table>
          </form>
          </body>
          </html>
          posted on 2009-05-27 23:24 天堂露珠 閱讀(199) 評論(0)  編輯  收藏 所屬分類: JSP
          主站蜘蛛池模板: 舟曲县| 琼结县| 商洛市| 罗平县| 淮阳县| 延寿县| 阿图什市| 德保县| 营口市| 册亨县| 丹江口市| 稷山县| 东山县| 彭山县| 辛集市| 图们市| 遵义县| 格尔木市| 炉霍县| 深泽县| 河津市| 伊春市| 郑州市| 高州市| 峡江县| 洛宁县| 依安县| 交城县| 乌鲁木齐市| 张家口市| 峡江县| 苗栗市| 东至县| 枣强县| 莱西市| 玛多县| 新乡市| 宜阳县| 三穗县| 高尔夫| 抚松县|