一、本文目录

        简单介绍SpEL的概念和使用
 
 
二、概念
  1. Spring 表达式语言(简称SpEL):是一个支持运行时查询和操作对象图的强大的表达式语言。语法类似于 EL:SpEL 使用 #{…} 作为定界符,所有在大框号中的字符都将被认为是 SpEL
  2. SpEL 为 bean 的属性进行动态赋值提供了便利
  3. 通过 SpEL 可以实现:
               通过 bean 的 id 对 bean 进行引用
               调用方法以及引用对象中的属性
               计算表达式的值
               正则表达式的匹配
 
三、使用
     1、直接使用字面量(数字或字符串)
字面量的表示:
整数:<property name="count" value="#{5}"/>
小数:<property name="frequency" value="#{89.7}"/>
科学计数法:<property name="capacity" value="#{1e4}"/>
String可以使用单引号或者双引号作为字符串的定界符号:<property name=“name” value="#{'Chuck'}"/> 或 <property name='name' value='#{"Chuck"}'/>
Boolean:<property name="enabled" value="#{false}"/>
 
      2、引用其他bean、bean的属性和方法
            value的值关联另一个bean,该bean的id为prefixGenerator
 

         3、支持运算符
 

                 4、调用Java的静态类和静态方法

 
四、相关资料
 
 
 
 

Spring_SpEL的更多相关文章

  1. spring 课程

    官网 参考文档 // 1. Spring_HelloWorld 20:22 // 2. Spring_IOC&DI概述 08:07 // 3. Spring_配置 Bean 21:58 // ...

随机推荐

  1. js的event.srcElement与event.target(触发事件对象)

    IE下,event对象有srcElement属性,但是没有target属性; Firefox下,event对象有target属性,但是没有srcElement属性.但他们的作用是相当的,即: fire ...

  2. HTML插入地图的方法

    方法/步骤 1.打开"百度地图生成器"的网址:http://api.map.baidu.com/lbsapi/creatmap/index.html 如下图: 2.在"1 ...

  3. 由于启动用户实例的进程时出错,导致无法生成 SQL Server 的用户实例。该连接将关闭。

    错误:由于启动用户实例的进程时出错,导致无法生成SQL Server的用户实例. 原因:添加安装SQLEXPRESS时,估计装在了不同的目录下: 解决方法:关闭Sqlserver及相关的程序,删除目录 ...

  4. poj1573 Robot Motion

    Robot Motion Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 12507   Accepted: 6070 Des ...

  5. toodifficult 题解

    名字听起来十分厉害啊...一道lzz的提交答案题. 提答题,我们看看题目,给出一个解密程序,叫你加密. 每个点有一个加密的sample和一些要加密的文本. 从题目中我们可以得到一些信息: 加密后一般为 ...

  6. 蓝灯github地址

    https://github.com/getlantern/lantern/ 闪电联盟蓝灯: http://bbs.sdbeta.com/read-htm-tid-556664.html

  7. python问题:IndentationError:expected an indented block错误解决《转》

    python问题:IndentationError:expected an indented block错误解决 标签: python语言 2012-07-07 17:59 125145人阅读 评论( ...

  8. AASM rule of scoring sleep stages using EEG signal

    Reference: AASM (2007). The AASM Manual for the Scoring of Sleep and Associated Events: Rules, Termi ...

  9. MVC 图片预览

    1.页面cshtml <form name="frmInput" id="frmInput" method="post" action ...

  10. web standards

    http://www.w3.org/standards/ http://www.webstandards.org/learn/faq/#p213 http://www.w3.org/standards ...