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)簽,感覺(jué)很新鮮,特別是datetimedipacker標(biāo)志感覺(jué)很好

          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顯示頁(yè)面
          <%@ 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) 閱讀(2903) 評(píng)論(1)  編輯  收藏 所屬分類(lèi): Spring/Hibernate/Struts2

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

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


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

          <2008年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(11)

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

          隨筆分類(lèi)

          隨筆檔案

          文章分類(lèi)

          文章檔案

          新聞分類(lèi)

          新聞檔案

          收藏夾

          圍脖

          最新隨筆

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 西乌珠穆沁旗| 定安县| 庐江县| 潼关县| 南投市| 上蔡县| 屯昌县| 抚宁县| 呼伦贝尔市| 毕节市| 新和县| 沙河市| 凌源市| 泰和县| 涟水县| 淮安市| 梨树县| 天镇县| 呼玛县| 五台县| 台安县| 湟中县| 会理县| 连江县| 孙吴县| 石林| 正阳县| 临汾市| 娄底市| 南和县| 邻水| 田阳县| 石景山区| 大悟县| 治多县| 靖宇县| 襄樊市| 灵川县| 水城县| 罗江县| 怀来县|