freemarker写select组件

1、宏定义

<#macro select id datas>
     <select id="${id}" name="${id}">
          <option>---请选择---</option>
          <#list datas as data>
              <option value="${data}">${data}</option>
          </#list>
     </select>
</#macro>

2、示例引入

<#import "/inc/select.ftl" as items/>
<@items.select id="city" datas=["武汉市","黄石市","黄冈市","荆州市"]/>

3、示例结果

(1)控制台打印结果

<select id="city" name="city">
          <option>---请选择---</option>
              <option value="武汉市">武汉市</option>
              <option value="黄石市">黄石市</option>
              <option value="黄冈市">黄冈市</option>
              <option value="荆州市">荆州市</option>
 </select>

(2)页面显示结果

freemarker写select组件(一)的更多相关文章

  1. freemarker写select组件(五)

    freemarker写select组件 1.宏定义 <#macro select id datas value="" key="" text=" ...

  2. freemarker写select组件(四)

    freemarker写select组件 1.宏定义 <#macro select id datas value="" key="" text=" ...

  3. freemarker写select组件(三)

    freemarker写select组件 1.宏定义 <#macro select id datas value="" key="" text=" ...

  4. freemarker写select组件(二)

    freemarker写select组件 1.宏定义 <#macro select id datas value=""> <select id="${id ...

  5. freemarker写select组件报错总结(一)

    1.具体错误如下 六月 25, 2014 11:26:29 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template pr ...

  6. freemarker写select组件报错总结(二)

    1.错误描述 六月 25, 2014 11:32:49 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...

  7. freemarker写select组件报错总结(七)

    1.错误描述 六月 26, 2014 11:26:27 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...

  8. freemarker写select组件报错总结(六)

    1.错误描述 六月 26, 2014 10:53:26 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...

  9. freemarker写select组件报错总结(五)

    1.错误描述 六月 26, 2014 10:44:49 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...

随机推荐

  1. SAP BAPI创建批次 为保存内部对象号

    使用BAPI:BAPI_BATCH_CREATE 创建批次时,能够保存成功,但是MCH1表和KSSK表中没有内部对象号. 无奈,查找源码. 最后在BAPI中调用的这个函数这里找到了问题.此处kzcla ...

  2. 再看Java基本类型

    Java中的基本类型可以分为三类,字符类型char,布尔类型boolean以及数值类型byte.short.int.long.float.double. 数值类型又可以分为整数类型byte.short ...

  3. [测试]java IO写入文件效率——几种方法比较

    各类写入方法 /** *1 按字节写入 FileOutputStream * * @param count 写入循环次数 * @param str 写入字符串 */ public void outpu ...

  4. chrome无法登陆账号,显示操作超时的解决方案

    起因 今天重装了下windows操作系统,准备登陆chrome浏览器,以同步各种插件(你懂的),结果是...无法登陆账号,显示操作超时,真是无语了. 碰到了这个问题第一个直觉是:FQ.突然想到如果修改 ...

  5. 关于git post-receive 钩子

    登录 git服务器 进入你项目所在git文件夹 cd /var/opt/gitlab/git-data/repositories/liangyuquan/yfg.git cd hooks vim po ...

  6. 【Tools】Pycharm2017 windows安装与修改中文界面教程

    [windows] 1.到官网下载Pycharm最新版 https://www.jetbrains.com/pycharm/download/#section=windows 2.安装激活 Pycha ...

  7. 携程Apollo(阿波罗)配置中心用户管理和部门管理

    Apollo是配置管理系统,会提供权限管理(Authorization),理论上是不负责用户登录认证功能的实现(Authentication).所以Apollo定义了一些SPI用来解耦,Apollo接 ...

  8. unity爬坑记录

    这里记一下平时遇到的unity bug: unity2017最好不要在prefab上面修改它上面的组件参数 最好是拖放到场景之后修改场景内的物体组件参数 完事了apply一下删掉 不这样做的话 可能u ...

  9. dcoker实战,使用docker部署NodeJs应用

    docker简介   docker是一个开源的应用容器引擎,可以为我们提供安全.可移植.可重复的自动化部署的方式.docker采用虚拟化的技术来虚拟化出应用程序的运行环境.如上图一样.docker就像 ...

  10. Tomcat启动出现:Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpringMvc]]解决办法

    严重: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component ...