<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-61  評論-159  文章-0  trackbacks-0
    在struts2中的jsp文件使用<s:head/>可以得到一些加入js的效果
    login.jsp
    <%@ page language="java" contentType="text/html; charset=GBK"%>
    <%@taglib prefix="s" uri="/struts-tags"%>
    <html>
    <head>
    <title>登錄頁面</title>
    <s:head/>
    </head>
    <body>
    <s:form action="Login.action" method="post">
        <s:textfield name="name" label="用戶名"/>
        <s:password name="password" label="密碼"/>
        <s:submit value="登錄"/>
      
    </s:form>
    </body>
    </html>
    1、輸入:http://localhost:8080/strutsdemo/login.jsp
    2、得到:
    沒有加<head/>時候得到

    加<s:head/>后,瀏覽器源文件代碼

     

     1<html>
     2<head>
     3<title>??¼???</title>
     4<link rel="stylesheet" href="/strutsdemo/struts/xhtml/styles.css" type="text/css"/>
     5<script type="text/javascript">
     6    // Dojo configuration
     7    djConfig = {
     8        baseRelativePath: "/strutsdemo/struts/dojo",
     9        isDebug: false,
    10        bindEncoding: "UTF-8",
    11        debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
    12    }
    ;
    13
    </script>
    14<script type="text/javascript"
    15        src="/strutsdemo/struts/dojo/dojo.js"></script>
    16<script type="text/javascript"
    17        src="/strutsdemo/struts/simple/dojoRequire.js"></script>
    18
    19</head>
    20<body>
    21   
    22<form id="Login" onsubmit="return true;" action="Login.action" method="post">
    23<table class="wwFormTable"> 
    24    <tr>
    25    <td class="tdLabel"><label for="Login_name" class="label">?û???:</label></td>
    26    <td
    27><input type="text" name="name" value="" id="Login_name"/>
    28</td>
    29</tr>
    30
    31    <tr>
    32    <td class="tdLabel"><label for="Login_password" class="label">????:</label></td>
    33    <td
    34><input type="password" name="password" id="Login_password"/>
    35</td>
    36</tr>
    37
    38    <tr>
    39    <td colspan="2"><div align="right"><input type="submit" id="Login_0" value="??¼"/>
    40</div></td>
    41</tr>
    42 
    43</table></form>
    44
    45</body>
    46</html>
    47


    3、由于加入了validation校驗框架,在沒有輸入用戶名跟密碼時候,按登錄產生一下界面

    瀏覽器的源代碼:

     1<html>
     2<head>
     3<title>登錄頁面</title>
     4<link rel="stylesheet" href="/strutsdemo/struts/xhtml/styles.css" type="text/css"/>
     5<script type="text/javascript">
     6    // Dojo configuration
     7    djConfig = {
     8        baseRelativePath: "/strutsdemo/struts/dojo",
     9        isDebug: false,
    10        bindEncoding: "UTF-8",
    11        debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
    12    }
    ;
    13
    </script>
    14<script type="text/javascript"
    15        src="/strutsdemo/struts/dojo/dojo.js"></script>
    16<script type="text/javascript"
    17        src="/strutsdemo/struts/simple/dojoRequire.js"></script>
    18
    19</head>
    20<body>
    21            
    22<form id="Login" onsubmit="return true;" action="Login.action" method="post">
    23<table class="wwFormTable"> 
    24    <tr errorFor="Login_name">
    25    <td align="center" valign="top" colspan="2"><span class="errorMessage">用戶名必填</span></td>
    26</tr>
    27<tr>
    28    <td class="tdLabel"><label for="Login_name" class="errorLabel">用戶名:</label></td>
    29    <td
    30><input type="text" name="name" value="" id="Login_name"/>
    31</td>
    32</tr>
    33
    34    <tr errorFor="Login_password">
    35    <td align="center" valign="top" colspan="2"><span class="errorMessage">密碼必填</span></td>
    36</tr>
    37<tr>
    38    <td class="tdLabel"><label for="Login_password" class="errorLabel">密碼:</label></td>
    39    <td
    40><input type="password" name="password" id="Login_password"/>
    41</td>
    42</tr>
    43
    44    <tr>
    45    <td colspan="2"><div align="right"><input type="submit" id="Login_0" value="登錄"/>
    46</div></td>
    47</tr>
    48
    49   
    50</table></form>
    51
    52
    53
    54
    55</body>
    56</html>


     



    -------------------------------------------------------------------------------------------------
    PS:本博客文章,如果沒有注明是有“轉”字樣,屬于本人原創。如果需要轉載,務必注明作者文章的詳細出處地址,否則不允許轉載,多謝合作!
    posted on 2007-11-02 20:37 apple0668 閱讀(4548) 評論(1)  編輯  收藏 所屬分類: struts2

    評論:
    # re: struts2中head標簽的使用 2008-01-03 17:33 | ElgooG
    thanks,  回復  更多評論
      
    主站蜘蛛池模板: 免费一级毛suv好看的国产网站 | 亚洲娇小性色xxxx| 亚洲色无码专区一区| 中文字幕版免费电影网站| 无码人妻精品中文字幕免费东京热| 黄页免费在线观看| 久久精品女人天堂AV免费观看| 免费亚洲视频在线观看| 亚洲码在线中文在线观看| 五月天婷婷精品免费视频| 免费人成视频在线| 亚洲熟妇成人精品一区| 毛片免费在线观看网址| 亚洲av永久无码精品网站| 亚洲av中文无码乱人伦在线观看 | 免费人成在线观看网站| 亚洲国产精品一区二区久久| 看Aⅴ免费毛片手机播放| 亚欧在线精品免费观看一区| 亚洲日韩小电影在线观看| 亚洲欧美在线x视频| 3d动漫精品啪啪一区二区免费| 亚洲综合最新无码专区| 亚洲AV香蕉一区区二区三区| 曰批全过程免费视频在线观看| 亚洲人成网www| 岛国av无码免费无禁网站| 日本系列1页亚洲系列| 久久99亚洲综合精品首页| 免费一级全黄少妇性色生活片| 国产成人亚洲综合| 狼群影院在线观看免费观看直播| 中文字幕乱码亚洲无线三区 | 亚洲第一香蕉视频| 免费观看一级毛片| 亚洲xxxx18| 久久亚洲国产精品123区| 亚洲一级毛片免费看| 成人福利在线观看免费视频| 亚洲图片在线观看| 免费a级毛片大学生免费观看|