隨筆 - 117  文章 - 72  trackbacks - 0

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

          常用鏈接

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

          訂閱

          訂閱

          留言簿(7)

          隨筆分類(130)

          隨筆檔案(123)

          搜索

          •  

          積分與排名

          • 積分 - 156402
          • 排名 - 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 天堂露珠 閱讀(200) 評論(0)  編輯  收藏 所屬分類: JSP
          主站蜘蛛池模板: 翁牛特旗| 上饶市| 遵义市| 普兰店市| 桓台县| 克拉玛依市| 盐津县| 长泰县| 赣州市| 临武县| 岫岩| 宜春市| 通许县| 甘孜县| 赫章县| 苗栗县| 浑源县| 太湖县| 敖汉旗| 公主岭市| 宿迁市| 五寨县| 特克斯县| 涞源县| 乌鲁木齐市| 霍林郭勒市| 英超| 吉木乃县| 南昌市| 蒲城县| 游戏| 卫辉市| 大荔县| 石景山区| 剑河县| 乌拉特后旗| 黄石市| 芒康县| 渭源县| 游戏| 于田县|