1. <%...@ page language="java" contentType="text/html; charset=GBK"%> 2. <%...@taglib prefix="s" uri="/struts-tags"%> 3. <html> 4. <head><s:head/> 5. <title>成功页面</title> 6. </head> 7. <body> 8. checkboxList标签:<br> 9. <s:form> 10. <!-- 使用简单集合来生成多个复选框 --> 11. <s:checkboxlist name="bookList" label="请选择你喜欢的技术" list="{'spring','hibernate','struts'}" labelposition="left"> 12. </s:checkboxlist> 13. <!-- 使用简单Map对象来生成多个复选框 --> 14. <s:checkboxlist name="bookMap" label="请选择你喜欢的出版日期" list="#{'spring':'2006','hibernate':'2007','struts':'2008'}" labelposition="left" 15. listKey="key" listValue="value"> 16. </s:checkboxlist> 17. 18. <!-- 使用集合里放多个JavaBean实例来生成多个复选框 --> 19. <s:bean name="lee.BookService" id="bs"></s:bean> 20. <s:checkboxlist name="bookBean" label="请选择你喜欢的图书" list="#bs.books" labelposition="left" 21. listKey="author" listValue="name"> 22. </s:checkboxlist> 23. 24. 25. 26. </s:form> 27. 28. <s:form> 29. combobox标签:combox标签中的下拉菜单和selcet不同,此仅为帮助输入而设计<br> 30. <s:combobox list="{'spring','hibernate','struts'}" size="100" maxlength="20" name="bookcombo" ></s:combobox> 31. </s:form> 32. 33. <s:form theme="simple"> 34. 日期选择部件,指定toggleType属性,且指定value="today"<br> 35. <s:datetimepicker name="order.date" label="购买日期" toggleType="explode" value="today"/><hr> 36. 日期选择部件,指定了format属性<br> 37. <s:datetimepicker name="order.date" label="购买日期" displayFormat="yyyy年MM月dd日"/><hr> 38. 日期选择部件,指定了weekStartsOn属性<br> 39. <s:datetimepicker name="order.date" label="购买日期" displayFormat="yyyy年MM月dd日" weekStartsOn="1"/><hr> 40. 时间选择部件<br> 41. <s:datetimepicker label="选择出发时间" type="time" /><hr> 42. </s:form> 43. 44. <s:form action="x"> 45. 使用doubleselect,必须指定form的action属性 46. 支持两项的doubleselect列表框 47. <s:doubleselect 48. label="请选择您喜欢的图书" 49. name="author" list="{'张三', '李四','王五'}" 50. doubleList="top == '张三' ? {'struts', 'spring' , 'hibernate'} : {'struts2','spring2.0','hibernate3.0'}" 51. doubleName="book"/> 52. 支持多项的doubleselect列表框 53. <s:set name="bs" value="# {'张三':{'struts1', 'spring1' , 'hibernat1'},'李四': {'struts2', 'spring2' , 'hibernate2'},'王五': {'struts3', 'spring3' , 'hibernate3'}}"></s:set> 54. <s:doubleselect 55. label="请选择您喜欢的图书" 56. name="authora" 57. list="#bs.keySet()" 58. doubleList="#bs[top]" 59. doubleName="booka"/> 60. </s:form> 61. 62. <s:form theme="simple"> 63. optiontransferselect标签使用 64. doubleList指定第二个list的内容,list指定第一个list的内容 65. <s:optiontransferselect 66. doubleList="{'struts','spring','hibernate'}" 67. list="{'struts2','spring2','hibernate2'}" 68. doubleName="2book" 69. name="1book" 70. leftTitle="升级版" 71. rightTitle="普通版" 72. multiple="true" 73. doubleMultiple="true" 74. addToLeftLabel="向左移动" 75. addToRightLabel="向右移动" 76. selectAllLabel="全部选择" 77. addAllToRightLabel="全部向右移动" 78. addAllToLeftLabel="全部向左移动" 79. emptyOption="true" 80. headerKey="1key" 81. headerValue="版本1图书" 82. doubleHeaderKey="2key" 83. doubleHeaderValue="版本2图书" 84. doubleEmptyOption="true"></s:optiontransferselect> 85. </s:form> 86. 87. <s:form theme="simple"> 88. select标签:使用简单集合 89. <s:select list="{'struts','spring','hibernate'}" name="a" multiple="true"></s:select><br> 90. select标签:使用map集合 91. <s:select list="#{'zhangsan':'struts','lisi':'spring','wangwu':'hibernate'}" 92. name="b" multiple="true" 93. listKey="key" listValue="value"></s:select><br> 94. select标签:使用集合里放多个javabean实例来生成下拉选择框 95. <s:bean name="lee.BookService" id="bs"/> 96. <s:select list="#bs.books" name="c" listKey="name" listValue="author"></s:select> 97. </s:form> 98. 99. 100. <s:form theme="simple"> 101. radio标签:使用简单集合 102. <s:radio list="{'struts','spring','hibernate'}" name="a"></s:radio><br> 103. radio标签:使用map集合 104. <s:radio list="#{'zhangsan':'struts','lisi':'spring','wangwu':'hibernate'}" 105. name="b" 106. listKey="key" listValue="value"></s:radio><br> 107. radio标签:使用集合里放多个javabean实例来生成下拉选择框 108. <s:bean name="lee.BookService" id="bs"/> 109. <s:radio list="#bs.books" name="c" listKey="name" listValue="author"></s:radio> 110. </s:form> 111. 112. <s:form theme="simple"> 113. optgroup标签,用于和select标签组合 114. <s:select list="#{'zhangsan':'struts','lisi':'spring','wangwu':'hibernate'}" 115. name="a" listKey="key" listValue="value"> 116. <s:optgroup label="Rob" 117. list="#{'jialiu':'ibatis','songqi':'xml'}" 118. listKey="value" 119. listValue="key"></s:optgroup> 120. <s:optgroup label="Ror" 121. list="#{'liuwi':'freemarker','ren1':'velocity'}" 122. listKey="value" 123. listValue="key"></s:optgroup> 124. </s:select> 125. </s:form> 126. 127. 128. <s:form theme="simple"> 129. updownselect标签:使用简单集合对象生成可上下移动选项的列表框 130. <s:updownselect name="ac" list="{'struts','spring','hibernate'}"></s:updownselect><br> 131. updownselect标签:使用map集合对象生成可上下移动选项的列表框 132. <s:updownselect list="#{'zhangsan':'struts','lisi':'spring','wangwu':'hibernate'}" 133. name="bc" moveDownLabel="向下移动" moveUpLabel="向上移动" 134. listKey="key" listValue="value" emptyOption="true"></s:updownselect><br> 135. updownselect标签:使用集合里放多个javabean实例来生成下拉选择框 136. <s:bean name="lee.BookService" id="bs"/> 137. <s:updownselect list="#bs.books" name="cc" selectAllLabel="全部选择" multiple="true" 138. listKey="name" listValue="author" moveDownLabel="向下移动" moveUpLabel="向上移动"></s:updownselect> 139. </s:form> 140. 141. 142. </body> 143. </html>