码迷,mamicode.com
首页 > 其他好文 > 详细

struts2学习(9)struts标签2(界面标签、其他标签)

时间:2017-07-01 22:45:44      阅读:399      评论:0      收藏:0      [点我收藏+]

标签:下拉框   check   ansi   get   ddt   insert   body   tags   span   

四、struts2界面标签:              

技术分享

五、其他标签:                      

技术分享

技术分享

1.界面标签:

uiTag.jsp:

技术分享
<body>
<h>界面标签</h>
<hr/>
<a href="ui/form.jsp" target="_blank">form标签</a><br/>
<a href="ui/text.jsp" target="_blank">文本标签</a><br/>
<a href="ui/radio.jsp" target="_blank">单选标签</a><br/>
<a href="ui/checkbox.jsp" target="_blank">复选框标签</a><br/>
<a href="ui/select.jsp" target="_blank">下拉框标签</a><br/>
</body>
View Code

技术分享

form.jsp:              

技术分享
<body>
<s:form action="hello" method="post" namespace="/foreground">
</s:form>
</body>
View Code

text.jsp:        

技术分享
<body>
用户名:<s:textfield name="userName"></s:textfield><br/>
密码:<s:password name="password"></s:password><br/>
备注:<s:textarea name="desc"></s:textarea><br/>
</body>
View Code

技术分享

radio.jsp:            

技术分享
<body>
性别:<s:radio list="#{0: ‘男 ‘, 1:‘女 ‘}" name="sex" value="0" /> 
</body>
View Code

技术分享

checkbox.jsp:                  

技术分享
<body>
爱好:<s:checkboxlist list="#{0: ‘游泳‘, 1:‘唱歌 ‘,2:‘跳舞‘}" name="hobby" value="1" /> 
</body>
View Code

技术分享

select.jsp:                      

技术分享
<body>
爱好:<s:select list="#{0: ‘游泳‘, 1:‘唱歌 ‘,2:‘跳舞‘}" name="hobby" value="1" multiple="true"/> 
</body>
View Code

技术分享

 

2. 其他标签:

otherTag.jsp:

技术分享
<body>
<h>其他标签</h>
<hr/>
<a href="other/updownselect.jsp" target="_blank">updownselect标签</a><br/>
<a href="other/optiontransferselect.jsp" target="_blank">optiontransferselect标签</a><br/>
</body>
View Code

updownselect.jsp:

技术分享
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<s:updownselect 
    list="#{0:‘游泳‘, 1:‘唱歌‘, 2:‘跳舞‘}"
    name="hobby" 
    headerKey="-1"
    headerValue="请选择" 
    emptyOption="true"
    allowMoveUp="true" 
    allowMoveDown="true" 
    allowSelectAll="true"
    moveUpLabel="Move Up" 
    moveDownLabel="Move Down"
    selectAllLabel="Select All" /> 
</body>
</html>
View Code

技术分享

optiontransferselect.jsp:

技术分享
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<s:optiontransferselect label="选择你喜欢图书"  
              name="cnbook" leftTitle="中文图书"  list="{‘struts2权威指南‘,‘轻量级javaeye 企业应用空实战‘,‘ajax讲义‘}"
              doubleName="enBook"  rightTitle="外文图书" doubleList="{‘JavaScrip:The definitive Guide‘,‘export one-to-one‘}"  multiple="true" 
              addToLeftLabel="向左移动" addToRightLabel="向右移动" addAllToRightLabel="全部右移" addAllToLeftLabel="全部左移"
               allowSelectAll="true" headerKey="cnKey" headerValue="选择图书" emptyOption="true"   doubleHeaderKey="enKey" 
               doubleHeaderValue="选择外文图书" doubleMultiple="true" doubleEmptyOption="true"  leftDownLabel="向下移动" 
       rightDownLabel="向下移动" 
       leftUpLabel="向上移动" 
       rightUpLabel="向上移动" >
   </s:optiontransferselect>
</body>
</html>
View Code

技术分享

 

struts2学习(9)struts标签2(界面标签、其他标签)

标签:下拉框   check   ansi   get   ddt   insert   body   tags   span   

原文地址:http://www.cnblogs.com/tenWood/p/7103534.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!