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


    四、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

  • 相关阅读:
    系统设计与架构笔记:对我新公司网站的技术架构初解
    与国内某知名互联网公司交流后的心得
    系统架构:Web应用架构的新趋势---前端和后端分离的一点想法
    为什么做java的web开发我们会使用struts2,springMVC和spring这样的框架?
    我设计的网站的分布式架构
    Python Day 46 前端 、HTML5介绍、HTML标签、标签的嵌套规则、CSS3介绍、CSS代码中书写位置(重点)、CSS基础选择器、
    Python Day 45 手撸ORM框架
    Python Day 44 Mysql数据库备份及优化(六)
    Python Day 43 Mysql基础语法(五)sqlalchemy、创建表、增删改查、高级查询操作、正向反向查询
    Python Day 42 Mysql基础语法(四)、存储引擎、索引、慢日志查询、普通日志记录(general log)、权限管理、explain工具
  • 原文地址:https://www.cnblogs.com/tenWood/p/7103534.html
Copyright © 2020-2023  润新知