要在jsp中使用Struts2的標志,先要指明標志的引入。通過jsp的代碼的頂部加入以下的代碼:
<%@taglib prefix="s" uri="/struts-tags" %>
If elseif else
描述:
執行基本的條件流轉。
參數:
名稱
必需
默認
類型
描述
備注
test
是
boolean
決定標志裡的內容是否顯示的表達式
else標志沒有這個參數
id
否
Object/String
用來標識元素的id。在UI和表單中為HTML的id屬性
例子:
</div>
<div>名稱</div>
<div>必需</div>
<div>默認</div>
<div>類型</div>
<div>描述</div>
<div>cols</div>
<div>否</div>
<div>無</div>
<div>Integer</div>
<div>列數</div>
<div>rows</div>
<div>否</div>
<div>無</div>
<div>Integer</div>
<div>行數</div>
<div>readonly</div>
<div>否</div>
<div>false</div>
<div>Boolean</div>
<div>當該屬性為true時,不能輸入</div>
<div>wrap</div>
<div>否</div>
<div>false</div>
<div>Boolean</div>
<div>指定多行文本輸入控件是否應該換行</div>
<div>id</div>
<div>否</div>
<div> </div>
<div>Object/String</div>
<div>用來標識元素的id。在ui和表單中為HTML的id屬性</div>
<div> </div>
<div>例子:</div>
<div><s:textarea name="personal" cols="10" rows="5" label="個人簡歷"></s:textarea></div>
<div> </div>
<div> </div>
<div> </div>
<div>下拉列表</div>
<div>s:select 標簽輸出一個下拉列表框,相當於HTML代碼中的<select/></div>
<div>名稱</div>
<div>必需</div>
<div>默認</div>
<div>類型</div>
<div>描述</div>
<div>list</div>
<div>是</div>
<div>無</div>
<div>Cellection Map Enumeration Iterator array</div>
<div>要迭代的集合,使用集合中的元素來設置各個選項,如果list的屬性為Map則Map的key成為選項的value,Map的value會成為選項的內容</div>
<div>listKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的value</div>
<div>listValue</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的內容</div>
<div>headerKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>設置當用戶選擇了header選項時,提交的的value,如果使用該屬性,不能為該屬性設置空值</div>
<div>headerValue</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>顯示在頁面中header選項內容</div>
<div>emptyOption</div>
<div>否</div>
<div>false</div>
<div>Boolean</div>
<div>是否在header選項後面添加一個空選項</div>
<div>multiple</div>
<div>否</div>
<div>false</div>
<div>Boolean</div>
<div>是否多選</div>
<div>size</div>
<div>否</div>
<div>無</div>
<div>Integer</div>
<div>顯示的選項個數</div>
<div> </div>
<div>例子:</div>
<div>%@ page contentType="text/html;charset=GBK" %></div>
<div><%@ taglib prefix="s" uri="/struts-tags" %></div>
<div> </div>
<div><h3>使用name和list屬性,list屬性的值是一個列表</h3></div>
<div><s:form></div>
<div> <s:select label="最高學歷" name="education" list="{'高中','大學','碩士','博士'}"/></div>
<div></s:form></div>
<div> </div>
<div><h3>使用name和list屬性,list屬性的值是一個Map</h3></div>
<div><s:form></div>
<div> <s:select label="最高學歷" name="education" list="#{1:'高中',2:'大學',3:'碩士',4:'博士'}"/></div>
<div></s:form></div>
<div> </div>
<div><h3>使用headerKey和headerValue屬性設置header選項</h3></div>
<div><s:form></div>
<div> <s:select label="最高學歷" name="education" list="{'高中','大學','碩士','博士'}"</div>
<div> headerKey="-1" headerValue="請選擇您的學歷"/></div>
<div></s:form></div>
<div> </div>
<div> </div>
<div><h3>使用emptyOption屬性在header選項後添加一個空的選項</h3></div>
<div><s:form></div>
<div> <s:select label="最高學歷" name="education" list="{'高中','大學','碩士','博士'}"</div>
<div> headerKey="-1" headerValue="請選擇您的學歷"</div>
<div> emptyOption="true"/></div>
<div></s:form></div>
<div> </div>
<div> </div>
<div><h3>使用multiple屬性設置多選</h3></div>
<div><s:form></div>
<div> <s:select label="最高學歷" name="education" list="{'高中','大學','碩士','博士'}"</div>
<div> headerKey="-1" headerValue="請選擇您的學歷"</div>
<div> emptyOption="true"</div>
<div> multiple="true"/></div>
<div></s:form></div>
<div> </div>
<div><h3>使用size屬性設置下拉框可顯示的選項個數</h3></div>
<div><s:form></div>
<div> <s:select label="最高學歷" name="education" list="{'高中','大學','碩士','博士'}"</div>
<div> headerKey="-1" headerValue="請選擇您的學歷"</div>
<div> emptyOption="true"</div>
<div> multiple="true" size="8"/></div>
<div></s:form></div>
<div> </div>
<div> </div>
<div><h3>使用listKey和listValue屬性,利用Action實例的屬性(property)來設置選項的值和選項的內容</h3></div>
<div><s:form></div>
<div> <s:select label="最高學歷" name="education" list="educations"</div>
<div> listKey="id" listValue="name"/></div>
<div></s:form</div>
<div> </div>
<div> </div>
<div> </div>
<div>doubleselect標簽</div>
<div>doubleselect標簽輸出關聯的兩個HTML列表框,產生聯動效果。</div>
<div>名稱</div>
<div>必需</div>
<div>默認</div>
<div>類型</div>
<div>描述</div>
<div>list</div>
<div>是</div>
<div>無</div>
<div>Cellection Map Enumeration Iterator array</div>
<div>要迭代的集合,使用集合中的元素來設置各個選項,如果list的屬性為Map則Map的key成為選項的value,Map的value會成為選項的內容</div>
<div>listKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的value,該選項只對第一個列表框起作用</div>
<div>listValue</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的內容,該選項只對第一個列表框起作用</div>
<div>headerKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>設置當用戶選擇了header選項時,提交的的value,如果使用該屬性,不能為該屬性設置空值</div>
<div>headerValue</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>顯示在頁面中header選項內容</div>
<div>emptyOption</div>
<div>否</div>
<div>false</div>
<div>Boolean</div>
<div> </div>
<div>multiple</div>
<div>否</div>
<div>false</div>
<div>Boolean</div>
<div>是否多選</div>
<div>size</div>
<div>否</div>
<div>無</div>
<div>Integer</div>
<div>顯示的選項個數,該選項只對第一個列表框起作用</div>
<div>doubleId</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定第二個列表框的ID</div>
<div>doubleList</div>
<div>是</div>
<div>無</div>
<div>Cellection Map Enumeration Iterator array</div>
<div>要迭代的集合</div>
<div>doubleListKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的value,該選項只對第二個列表框起作用</div>
<div>doubleListValue</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的內容,該選項只對第二個列表框起作用</div>
<div>doubleSize</div>
<div>否</div>
<div>無</div>
<div>Integer</div>
<div>選項個數</div>
<div>doubleName</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定第二個列表框的name映射</div>
<div>doubleValue</div>
<div>否</div>
<div>無</div>
<div>Object</div>
<div>第二個列表框的初始選種項</div>
<div> </div>
<div>實例:</div>
<div><s:form name="test"></div>
<div> <s:doubleselect label="請選擇所在省市"</div>
<div> name="province" list="{'四川省','山東省'}" doubleName="city"</div>
<div> doubleList="top == '四川省' ? {'成都市', '綿陽市'} : {'濟南市', '青島市'}" /></div>
<div></s:form></div>
<div> </div>
<div><s:form action="doubleselectTag"></div>
<div> <s:doubleselect</div>
<div> label="請選擇所在省市"</div>
<div> name="province"</div>
<div> list="provinces"</div>
<div> listKey="id"</div>
<div> listValue="name"</div>
<div> doubleList="cities"</div>
<div> doubleListKey="id"</div>
<div> doubleListValue="name"</div>
<div> doubleName="city"</div>
<div> headerKey="-1"</div>
<div> headerValue="---------- 請選擇 ----------"</div>
<div> emptyOption="true" /></div>
<div></s:form></div>
<div> </div>
<div>復選框</div>
<div>名稱</div>
<div>必需</div>
<div>默認</div>
<div>類型</div>
<div>描述</div>
<div>fieldValue</div>
<div>是</div>
<div>true</div>
<div>String</div>
<div>指定在復選框選中時,實際提交的值</div>
<div> </div>
<div>復選框組,對應Action中的集合</div>
<div>名稱</div>
<div>必需</div>
<div>默認</div>
<div>類型</div>
<div>描述</div>
<div>list</div>
<div>是</div>
<div>無</div>
<div>Cellection Map Enumeration Iterator array</div>
<div>要迭代的集合,使用集合中的元素來設置各個選項,如果list的屬性為Map則Map的key成為選項的value,Map的value會成為選項的內容</div>
<div>listKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的value</div>
<div>listValue</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的內容</div>
<div>例子:checkboxlistTag.jsp</div>
<div><%@ page contentType="text/html;charset=GBK" %></div>
<div><%@ taglib prefix="s" uri="/struts-tags" %></div>
<div><s:form></div>
<div> <s:checkboxlist name="interest" list="{'足球','籃球','排球','游泳'}" label="興趣愛好"/></div>
<div></s:form></div>
<div> </div>
<div>單擊復選框</div>
<div> </div>
<div>文件選擇組建</div>
<div>file標簽輸出一個HTML文件選擇框。</div>
<div>名稱</div>
<div>必需</div>
<div>默認</div>
<div>類型</div>
<div>描述</div>
<div>accept</div>
<div>否</div>
<div>input</div>
<div>String</div>
<div>HTML accept屬性,指出接受文件的MIME類型</div>
<div> </div>
<div>按鈕</div>
<div>Submit標簽輸出一個按鈕,submit標簽和form標簽使用可以提供異步表單提交功能。Submit標簽可以輸出以下三種類型的提交按鈕:</div>
<div>Input: 等價於 HTML代碼<input type=”submit”></div>
<div>Image: 等價於 HTML代碼 <input type="image"></div>
<div>Button:<button type="submit"></button></div>
<div>名稱</div>
<div>必需</div>
<div>默認</div>
<div>類型</div>
<div>描述</div>
<div>type</div>
<div>否</div>
<div>input</div>
<div>String</div>
<div>要使用的提交按鈕的類型,有效值:input button image</div>
<div>src</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>為image類型的提交按鈕設置圖片地址。該屬性對input和button類型的提交按鈕無效</div>
<div>action</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定處理提交請求的action</div>
<div>method</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定處理提交請求的action的方法</div>
<div>實例</div>
<div>實例1.<s:submit type="image" method="login" src="images/login.jpg"></s:submit></div>
<div>頁面輸出:</div>
<div><input type="image" alt="Submit" data-cke-saved-src="images/login.jpg" src="images/login.jpg" id="user__login" data-cke-saved-name="method:login" name="method:login" value="Submit"/></div>
<div> </div>
<div>實例2.<s:submit type="button" action="selectTag" method="login" label="登陸"></s:submit></div>
<div>頁面輸出:</div>
<div><button type="submit" id="user_selectTag_login" name="action:selectTag!login" value="Submit">登陸</button></div>
<div> </div>
<div>Struts2預定義的前綴:</div>
<div>1。method method:login</div>
<div>使用method前綴,來取代action默認的execute()方法的執行。</div>
<div><s:form action="user"></div>
<div> <s:textfield name="user.username" label="用戶名"></s:textfield></div>
<div> <s:textfield name="user.password" label="密碼"></s:textfield></div>
<div> <s:submit value="登陸" name="method:login"></s:submit></div>
<div> <s:submit value="注冊" name="method:register"></s:submit></div>
<div></s:form></div>
<div> </div>
<div>注意:1。input類型的按鈕,不能用label設置按鈕上的文本,只能用value</div>
<div>2、action前綴</div>
<div>使用action前綴,取代form標簽指定的action,導向到另一個action進行處理。</div>
<div><s:form action="login"></div>
<div> <s:textfield name="user.username" label="用戶名"></s:textfield></div>
<div> <s:textfield name="user.password" label="密碼"></s:textfield></div>
<div> <s:submit value="登陸"></s:submit></div>
<div> <s:submit value="注冊" name="action:register"></s:submit></div>
<div></s:form></div>
<div> </div>
<div>2、redirect前綴</div>
<div>使用redirect前綴請求重定向到其他的url,甚至可以是web英語程序外部的url。</div>
<div><s:form action="login"></div>
<div> <s:textfield name="user.username" label="用戶名"></s:textfield></div>
<div> <s:textfield name="user.password" label="密碼"></s:textfield></div>
<div> <s:submit value="登陸"></s:submit></div>
<div> <s:submit value="搜索" name="redirect:www.google.com"></s:submit></div>
<div></s:form></div>
<div>2、redirect-action前綴</div>
<div>使用redirect-action前綴請求重定向到其他的action.</div>
<div><s:form action="login"></div>
<div> <s:textfield name="user.username" label="用戶名"></s:textfield></div>
<div> <s:textfield name="user.password" label="密碼"></s:textfield></div>
<div> <s:submit value="登陸"></s:submit></div>
<div> <s:submit value="搜索" name="redirect-action:register"></s:submit></div>
<div></s:form></div>
<div>reset標簽</div>
<div>reset標簽輸出一個重置按鈕</div>
<div>名稱</div>
<div>必需</div>
<div>默認</div>
<div>類型</div>
<div>描述</div>
<div>type</div>
<div>否</div>
<div>input</div>
<div>String</div>
<div>要使用的重置按鈕的內容,input、button</div>
<div> </div>
<div><s:reset value="重置"></s:reset></div>
<div><s:reset type="button" label="重置"></s:reset></div>
<div>updownselect標簽</div>
<div>updownselect標簽創建一個帶有上下移動的按鈕的列表框,可以通過上下移動按鈕來調整列表框的選項的位置。</div>
<div> </div>
<div>名稱</div>
<div>必需</div>
<div>默認</div>
<div>類型</div>
<div>描述</div>
<div>list</div>
<div>是</div>
<div>無</div>
<div>Cellection Map Enumeration Iterator array</div>
<div>要迭代的集合,使用集合中的元素來設置各個選項,如果list的屬性為Map則Map的key成為選項的value,Map的value會成為選項的內容</div>
<div>listKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的value</div>
<div>listValue</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的內容</div>
<div>headerKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>設置當用戶選擇了header選項時,提交的的value,如果使用該屬性,不能為該屬性設置空值</div>
<div>headerValue</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>顯示在頁面中header選項內容</div>
<div>emptyOption</div>
<div>否</div>
<div>false</div>
<div>Boolean</div>
<div>是否在header選項後面添加一個空選項</div>
<div>multiple</div>
<div>否</div>
<div>false</div>
<div>Boolean</div>
<div>是否多選</div>
<div>size</div>
<div>否</div>
<div>無</div>
<div>Integer</div>
<div>顯示的選項個數</div>
<div>moveUplabel</div>
<div>否</div>
<div> </div>
<div>String</div>
<div>設置向上移動按鈕上的文本</div>
<div>moveDownLabel</div>
<div>否</div>
<div> </div>
<div>String</div>
<div>設置向下移動按鈕上的文本</div>
<div>selectAllLabel</div>
<div>否</div>
<div> </div>
<div>String</div>
<div>設置向全部選擇按鈕上的文本</div>
<div>allowMoveUp</div>
<div>否</div>
<div>無</div>
<div>Boolean</div>
<div>設置是否使用向上移動按鈕</div>
<div>allowMoveDown</div>
<div>否</div>
<div>無</div>
<div>Boolean</div>
<div>設置是否使用向下移動按鈕</div>
<div>allowSelectAll</div>
<div>否</div>
<div>無</div>
<div>Boolean</div>
<div>設置是否使用全部選擇按鈕</div>
<div> </div>
<div>實例:</div>
<div><s:form></div>
<div><!--{cke_protected}{C}%3C!%2D%2D%20%E4%BD%BF%E7%94%A8%E7%AE%80%E5%8D%95%E9%9B%86%E5%90%88%E6%9D%A5%E7%94%9F%E6%88%90%E5%8F%AF%E4%B8%8A%E4%B8%8B%E7%A7%BB%E5%8A%A8%E9%80%89%E9%A1%B9%E7%9A%84%E4%B8%8B%E6%8B%89%E9%80%89%E6%8B%A9%E6%A1%86%20%2D%2D%3E--></div>
<div><s:updownselect name="a" label="請選擇您喜歡的圖書" labelposition="top"</div>
<div> moveUpLabel="向上移動"</div>
<div> list="{'Spring2.0寶典' , '輕量級J2EE企業應用實戰' , 'JavaScript: The Definitive Guide'}"/></div>
<div> </div>
<div> </div>
<div><!--{cke_protected}{C}%3C!%2D%2D%20%E4%BD%BF%E7%94%A8%E7%AE%80%E5%8D%95Map%E5%AF%B9%E8%B1%A1%E6%9D%A5%E7%94%9F%E6%88%90%E5%8F%AF%E4%B8%8A%E4%B8%8B%E7%A7%BB%E5%8A%A8%E9%80%89%E9%A1%B9%E7%9A%84%E4%B8%8B%E6%8B%89%E9%80%89%E6%8B%A9%E6%A1%86%3C%2Fdiv%3E%0A%3Cdiv%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%E4%B8%94%E4%BD%BF%E7%94%A8emptyOption%3D%22true%22%E5%A2%9E%E5%8A%A0%E4%B8%80%E4%B8%AA%E7%A9%BA%E9%80%89%E9%A1%B9%2D%2D%3E--></div>
<div><s:updownselect name="b" label="請選擇您想選擇出版日期" labelposition="top"</div>
<div> moveDownLabel="向下移動"</div>
<div> list="#{'Spring2.0寶典':'2006年10月' , '輕量級J2EE企業應用實戰':'2007月4月' , '基於J2EE的Ajax寶典':'2007年6月'}"</div>
<div> listKey="key"</div>
<div> emptyOption="true"</div>
<div> listValue="value"/></div>
<div> </div>
<div><s:bean name="com.zhaosoft.ui.formtag.BookService" id="bs"/></div>
<div><!--{cke_protected}{C}%3C!%2D%2D%20%E4%BD%BF%E7%94%A8%E9%9B%86%E5%90%88%E9%87%8C%E6%94%BE%E5%A4%9A%E4%B8%AAJavaBean%E5%AE%9E%E4%BE%8B%E6%9D%A5%E5%8F%AF%E4%B8%8A%E4%B8%8B%E7%A7%BB%E5%8A%A8%E9%80%89%E9%A1%B9%E7%9A%84%E7%94%9F%E6%88%90%E4%B8%8B%E6%8B%89%E9%80%89%E6%8B%A9%E6%A1%86%20%2D%2D%3E--></div>
<div><s:updownselect name="c" label="請選擇您喜歡的圖書的作者" labelposition="top"</div>
<div> selectAllLabel="全部選擇" multiple="true"</div>
<div> list="#bs.books"</div>
<div> listKey="author"</div>
<div> listValue="name"/></div>
<div></s:form></div>
<div> </div>
<div>package com.zhaosoft.ui.formtag;</div>
<div>publicclass BookService</div>
<div>{</div>
<div> public Book[] getBooks()</div>
<div> {</div>
<div> returnnew Book[]</div>
<div> {</div>
<div> new Book("Spring2.0寶典","zhaosoft"),</div>
<div> new Book("輕量級J2EE企業應用實戰","zhaosoft"),</div>
<div> new Book("基於J2EE的Ajax寶典","zhaosoft")</div>
<div> };</div>
<div> }</div>
<div>}</div>
<div> </div>
<div> </div>
<div> </div>
<div>optiontransferselect標簽</div>
<div>optiontransferselect標簽創建一個選項轉移列表組建,它由兩個<select>標簽以及它們之間的用於將選項在兩個<select>之間相互移動的按鈕組成。表單提交時,將提交兩個列表框中選中的選項。</div>
<div>名稱</div>
<div>必需</div>
<div>默認</div>
<div>類型</div>
<div>描述</div>
<div>list</div>
<div>是</div>
<div>無</div>
<div>Cellection Map Enumeration Iterator array</div>
<div>要迭代的集合,使用集合中的元素來設置各個選項,如果list的屬性為Map則Map的key成為選項的value,Map的value會成為選項的內容,該選項只對第一個列表框起作用</div>
<div>listKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的value,該選項只對第一個列表框起作用</div>
<div>listValue</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的內容,該選項只對第一個列表框起作用</div>
<div>headerKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>設置當用戶選擇了header選項時,提交的的value,如果使用該屬性,不能為該屬性設置空值</div>
<div>headerValue</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>顯示在頁面中header選項內容</div>
<div>multiple</div>
<div>否</div>
<div>false</div>
<div>Boolean</div>
<div>是否多選</div>
<div>size</div>
<div>否</div>
<div>無</div>
<div>Integer</div>
<div>顯示的選項個數,該選項只對第一個列表框起作用</div>
<div>doubleId</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定第二個列表框的ID</div>
<div>doubleList</div>
<div>是</div>
<div>無</div>
<div>Cellection Map Enumeration Iterator array</div>
<div>要迭代的集合,使用集合中的元素來設置各個選項,如果doubleList的屬性為Map則Map的key成為選項的value,Map的value會成為選項的內容,該選項只對第二個列表框起作用</div>
<div>doubleListKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的value,該選項只對第二個列表框起作用</div>
<div>doubleListValue</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定集合對象中的哪個屬性作為選項的內容,該選項只對第二個列表框起作用</div>
<div>doubleHeaderKey</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>設置當用戶選擇了header選項時,提交的的value,如果使用該屬性,不能為該屬性設置空值</div>
<div>doubleHeaderVale</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>顯示在頁面中header選項內容</div>
<div>doubleEmptyOption</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>是否在第二列表框的header後面添加一個空選項</div>
<div>doubleMultiple</div>
<div>否</div>
<div>true</div>
<div>Boolean</div>
<div>是否多選</div>
<div>doubleSize</div>
<div>否</div>
<div>無</div>
<div>Integer</div>
<div>選項個數</div>
<div>doubleName</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>指定第二個列表框的name映射</div>
<div>doubleValue</div>
<div>否</div>
<div>無</div>
<div>Object</div>
<div>第二個列表框的初始選種項</div>
<div>leftTitle</div>
<div>否</div>
<div>無</div>
<div>String</div>
<div>左邊列表框的標題</div>
<div>rightTitle</div>
<div>否</div>
<div><-</div>
<div>String</div>
<div>右邊列表框的標題</div>
<div>addToLeftLable</div>
<div>否</div>
<div> </div>
<div>String</div>
<div> </div>
<div>addToRightLable</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>addAllToLeftLable</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>addAllToRightLable</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>leftUpLabel</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>leftDownLabel</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>rightUpLabel</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>rightDownLabel</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>allowAddToLeft</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>allowAddToright</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>allowAddAllToLeft</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>allowAddAllToRight</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>allowSelectAll</div>
<div>否</div>
<div>無</div>
<div>Boolean</div>
<div>設置是否使用全部選擇按鈕</div>
<div>allowUpdownOnLeft</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>allowUpDownOnRight</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>例子:</div>
<div><s:head/></div>
<div><s:form></div>
<div> <s:optiontransferselect</div>
<div> label="最喜愛的圖書"</div>
<div> name="javaBook"</div>
<div> list="{'《Java Web開發詳解》', '《Struts 2深入詳解》', '《Java快速入門》'}"</div>
<div> doubleName="cBook"</div>
<div> doubleList="{'《VC++深入詳解》', '《C++ Primer》', '《C++程序設計語言》'}"/></div>
<div></s:form></div>
<div>---------------------------</div>
<div><s:form></div>
<div> <s:optiontransferselect</div>
<div> label="最喜愛的圖書"</div>
<div> name="book1"</div>
<div> leftTitle="Java圖書"</div>
<div> rightTitle="C/C++圖書"</div>
<div> list="{'《Java Web開發詳解》', '《Struts 2深入詳解》', '《Java快速入門》'}"</div>
<div> headerKey="-1"</div>
<div> headerValue="--- 請選擇 ---"</div>
<div> emptyOption="true"</div>
<div> doubleName="book2"</div>
<div> doubleList="{'《VC++深入詳解》', '《C++ Primer》', '《C++程序設計語言》'}"</div>
<div> doubleHeaderKey="-1"</div>
<div> doubleHeaderValue="--- 請選擇 ---"</div>
<div> doubleEmptyOption="true"</div>
<div> addToLeftLabel="向左移動"</div>
<div> addToRightLabel="向右移動"</div>
<div> addAllToLeftLabel="全部左移"</div>
<div> addAllToRightLabel="全部右移"</div>
<div> selectAllLabel="全部選擇"</div>
<div> leftUpLabel="向上移動"</div>
<div> leftDownLabel="向下移動"</div>
<div> rightUpLabel="向上移動"</div>
<div> rightDownLabel="向下移動"/></div>
<div></s:form></div>