var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-20738293-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script')"/>

          jutleo
          歡迎走進(jìn)有風(fēng)的地方~~
          posts - 63,  comments - 279,  trackbacks - 0
          這些都是Struts2的一些新標(biāo)簽,感覺很新鮮,特別是datetimedipacker標(biāo)志感覺很好

          filevalidateExample.jsp 文件
          <%@ page language="java" contentType="text/html; charset=ISO-8859-5"
              pageEncoding
          ="ISO-8859-5"%>
          <%@ taglib prefix="s" uri="/struts-tags"%>
          <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
          <html>
          <head>
          <title>fieldValidatorsExample test</title>
          <s:url id="siteCss" includeContext="true"
              value
          ="/validationExamplesStyles.css" />
          <s:head theme="xhtml" />

          </head>
          <body>
          <h3>All field Error will show</h3>
          <s:fielderror />
          <hr color="red" />

          <s:form action="fieldValidators" method="post">
              
          <s:textfield tooltip="ENTER YOUR NAME" label="YOUR NAME" name="name" />
              
          <s:textfield tooltip="ENTER YOUR AGE" label="YOUR AGE" name="age" />

              
          <s:datetimepicker tooltip="ENTER YOUR BIRTHDAY" label="YOUR BIRTHDAY"
                  name
          ="birthday" />

              
          <s:textfield tooltip="ENTER YOUR EMAIL" label="YOUR EMAIL" name="Email" />
              
          <s:textfield tooltip="ENTER YOUR URL" label="YOUR URL" name="url" />

              
          <s:select tooltip="SELECT YOUR PROGRAM" label="YOUR PROGRAM"
                  name
          ="program" list="{'Java','.net','C#','Struts2'}" />

              
          <s:checkboxlist tooltip="SELECT YOUR FAVOURITE COLOR"
                  label
          ="FAVOURITE COLOR" name="color"
                  list
          ="{'red','green','yellow','pink','blue'}" value="{'green','blue'}" />

              
          <s:tree label="parent" id="parentId" theme="ajax"
                  templateCssPath
          ="/struts/tree.css" showRootGrid="true" showGrid="true">
                  
          <s:treenode theme="ajax" label="child1" id="child1Id">
                      
          <s:treenode theme="ajax" label="grandchild1" id="grandchild1Id" />
                      
          <s:treenode theme="ajax" label="grandchild2" id="grandchild2Id" />
                      
          <s:treenode theme="ajax" label="grandchild3" id="grandchild3Id" />
                  
          </s:treenode>

                  
          <s:treenode theme="ajax" label="child2" id="child2Id" />
                  
          <s:treenode theme="ajax" label="child3" id="child3Id" />
                  
          <s:treenode theme="ajax" label="child4" id="child4Id" />
                  
          <s:treenode theme="ajax" label="child5" id="child5Id">
                      
          <s:treenode theme="ajax" label="gChild1" id="gChild1Id" />
                      
          <s:treenode theme="ajax" label="gChild2" id="gChild2Id" />
                  
          </s:treenode>
              
          </s:tree>

              
          <s:hidden name="hiddenName" value="bulktree and oakertree" />
              
          <s:submit label="SUBMIT" />

          </s:form>

          </body>
          </html>
          FileValidateAction.java文件
          package com.bulktree.struts2;

          import java.util.Date;

          import com.opensymphony.xwork2.ActionSupport;

          public class FieldValidatorsAction extends ActionSupport {
              
          private String name = null;
              
          private Integer age = null;
              
          private Date birthday = null;
              
          private String Email = null;
              
          private String url = null;
              
          private String program = null;
              
          private String color = null;
              
          private String hiddenName = null;
              
          private String child2 = null;
              
              
              
              
          public String getChild2() {
                  
          return child2;
              }

              
          public void setChild2(String child2) {
                  
          this.child2 = child2;
              }

              
          public String getHiddenName() {
                  
          return hiddenName;
              }

              
          public void setHiddenName(String hiddenName) {
                  
          this.hiddenName = hiddenName;
              }

              
          public String getColor() {
                  
          return color;
              }

              
          public void setColor(String color) {
                  
          this.color = color;
              }

              
          public String getProgram() {
                  
          return program;
              }

              
          public void setProgram(String program) {
                  System.out.println(
          "*****setProgram**********");
                  
          this.program = program;
              }

              
          public String getName() {
                  
          return name;
              }

              
          public void setName(String name) {
                  
          this.name = name;
              }

              
          public Integer getAge() {
                  
          return age;
              }

              
          public void setAge(Integer age) {
                  
          this.age = age;
              }

              
          public Date getBirthday() {
                  
          return birthday;
              }

              
          public void setBirthday(Date birthday) {
                  
          this.birthday = birthday;
              }

              
          public String getEmail() {
                  
          return Email;
              }

              
          public void setEmail(String email) {
                  Email 
          = email;
              }

              
          public String getUrl() {
                  
          return url;
              }

              
          public void setUrl(String url) {
                  
          this.url = url;
              }

              
              @Override
              
          public String execute() throws Exception {
                  
                  
          return SUCCESS;
              }

              
              @Override
              
          public void validate() {
                  
              }

              
              
              
          }

          struts.xml配置片段
          <action name="fieldValidators"
                      class
          ="com.bulktree.struts2.FieldValidatorsAction">
                      
          <result>/welcome.jsp</result>
                  
          </action>
          welcome.jsp顯示頁面
          <%@ page language="java" contentType="text/html; charset=GB2312"
              pageEncoding
          ="GB2312"%>
          <%@ taglib prefix="s" uri="/struts-tags"%>
          <!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=GB2312">
          <title>login</title>
          </head>
          <body>
          YOUR USERNAME:
          <FONT size="5" color="red"><s:property value="username" /></FONT>
          <br>
          YOUR PASSWORD:
          <FONT size="5" color="red"><s:property value="password" /></FONT>
          <br>

          YOUR USERNAME:
          <FONT size="5" color="red"><s:property value="user.username" /></FONT>
          <br>
          YOUR PASSWORD:
          <FONT size="5" color="red"><s:property value="user.password" /></FONT>
          <br>

          YOUR NAME:
          <FONT size="5" color="red"><s:property value="name" /></FONT>
          <br>
          YOUR AGE:
          <FONT size="5" color="red"><s:property value="age" /></FONT>
          <br>
          YOUR BIRTHDAY:
          <FONT size="5" color="red"><s:property value="birthday" /></FONT>
          <br>
          YOUR EMAIL:
          <FONT size="5" color="red"><s:property value="Email" /></FONT>
          <br>
          YOUR URL:
          <FONT size="5" color="red"><s:property value="url" /></FONT>
          <br>
          YOUR PROGARAM:
          <FONT size="5" color="red"><s:property value="program" /></FONT>
          <br>
          YOUR FAVOURITE COLOR:
          <FONT size="5" color="red"><s:property value="color" /></FONT>
          <br>
          YOUR HIDDEN NAME
          <FONT size="5" color="red"><s:property value="hiddenName" /></FONT>
          <br>

          TREE:
          <s:property value="child2" />

          </body>
          </html>
          posted on 2008-01-04 22:01 凌晨風(fēng) 閱讀(2894) 評論(1)  編輯  收藏 所屬分類: Spring/Hibernate/Struts2

          FeedBack:
          # re: Struts2常用標(biāo)簽[未登錄]
          2008-07-20 16:35 | fire
          請問下 那個標(biāo)簽風(fēng)格怎么設(shè)置的,那個css樣式怎么整啊?
            回復(fù)  更多評論
            

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           

          <2008年1月>
          303112345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(11)

          我參與的團(tuán)隊(duì)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          新聞分類

          新聞檔案

          收藏夾

          圍脖

          最新隨筆

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 磐石市| 莆田市| 庆元县| 盐亭县| 新民市| 梧州市| 岳西县| 韶关市| 舞钢市| 阿合奇县| 临夏县| 峨山| 威远县| 天祝| 防城港市| 安多县| 台南县| 大邑县| 黄陵县| 湖口县| 南宫市| 宜丰县| 巫山县| 开原市| 永德县| 信宜市| 东乡| 航空| 社旗县| 大邑县| 云南省| 赤城县| 丹寨县| 乃东县| 墨脱县| 文昌市| 五河县| 汽车| 高清| 盐边县| 中牟县|