zoukankan      html  css  js  c++  java
  • Struts2标签select菜单栏

      1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
      2 <%@taglib prefix="s" uri="/struts-tags" %>
      3 
      4 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      5 <html>
      6   <head>
      7     <title>My JSP 'index3.jsp.jsp' starting page</title>
      8     
      9     <meta http-equiv="pragma" content="no-cache">
     10     <meta http-equiv="cache-control" content="no-cache">
     11     <meta http-equiv="expires" content="0">    
     12     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
     13     <meta http-equiv="description" content="This is my page">
     14     <!--
     15     <link rel="stylesheet" type="text/css" href="styles.css">
     16     -->
     17 
     18   </head>
     19   
     20   <body>
     21     <h3>使用name和list属性,list属性的值是一个列表</h3>
     22 
     23 <s:form>
     24 
     25     <s:select label="最高学历" name="education" list="{'高中','大学','硕士','博士'}"/>
     26 
     27 </s:form>
     28 
     29  
     30 
     31 <h3>使用name和list属性,list属性的值是一个Map</h3>
     32 
     33 <s:form>
     34 
     35     <s:select label="最高学历" name="education" list="#{1:'高中',2:'大学',3:'硕士',4:'博士'}"/>
     36 
     37 </s:form>
     38 
     39  
     40 
     41 <h3>使用headerKey和headerValue属性设置header选项</h3>
     42 
     43 <s:form>
     44 
     45     <s:select label="最高学历" name="education" list="{'高中','大学','硕士','博士'}"
     46 
     47        headerKey="-1" headerValue="请选择您的学历"/>
     48 
     49 </s:form>
     50 
     51  
     52 
     53  
     54 
     55 <h3>使用emptyOption属性在header选项后添加一个空的选项</h3>
     56 
     57 <s:form>
     58 
     59     <s:select label="最高学历" name="education" list="{'高中','大学','硕士','博士'}"
     60 
     61        headerKey="-1" headerValue="请选择您的学历"
     62 
     63        emptyOption="true"/>
     64 
     65 </s:form>
     66 
     67  
     68 
     69  
     70 
     71 <h3>使用multiple属性设置多选</h3>
     72 
     73 <s:form>
     74 
     75     <s:select label="最高学历" name="education" list="{'高中','大学','硕士','博士'}"
     76 
     77        headerKey="-1" headerValue="请选择您的学历"
     78 
     79        emptyOption="true"
     80 
     81        multiple="true"/>
     82 
     83 </s:form>
     84 
     85  
     86 
     87 <h3>使用size属性设置下拉框可显示的选项个数</h3>
     88 
     89 <s:form>
     90 
     91     <s:select label="最高学历" name="education" list="{'高中','大学','硕士','博士'}"
     92 
     93        headerKey="-1" headerValue="请选择您的学历"
     94 
     95        emptyOption="true"
     96 
     97        multiple="true" size="8"/>
     98 
     99 </s:form>
    100 
    101  </body>
    102 </html>
  • 相关阅读:
    Python 网络编程 C/S建立Socket连接
    odoo 安装配置
    epoll poll select区别
    SyntaxError :invalid syntax Python常见错误
    TypeError: Can't convert 'int' object to str implicitly Python常见错误
    IndexError: list index out of range Python常见错误
    NameError: name 'foo' is not defined Python常见错误
    IndentationError:unexpected indent”、“IndentationError:unindent does not match any outer indetation level”以及“IndentationError:expected an indented block Python常见错误
    TypeError: 'str' object does not support item assignment Python常见错误
    每周总结
  • 原文地址:https://www.cnblogs.com/huanglibin/p/3091002.html
Copyright © 2011-2022 走看看