SpEL表达式
来源:互联网 发布:mysql索引上创建 编辑:程序博客网 时间:2024/05/22 16:41
#{T(System).currentTimeMillis()}
T()表达式会将java.lang.System视为java中对应的类型
#{systemProperties['disc.title']}
通过systemProperties对象引用系统属性
#{artistSelector.selectArtist()?.toUpperCase()}
若?左边的内容为null,则不会调用toUpperCase()方法,返回null
T(java.lang.Math).random()
0~1之间的随机数
#{2*T(java.lang.Math).PI *circle.radius}
ID为circle的bean中圆的周长
#{counter.total == 100}#{counter.total eq 100}
结果一样,返回false或者true
#{scoreboard.score > 1000?"Winner":"Loser"}#{disc.title ?: 'Rattle and Hum'}
判断disc.title是否为null,如果是null,表达式结果为Rattle and Hum
#{admin.email matches '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.com'}
返回true或false
#{jukebox.songs[4].title}
ID是jukebox的bean中,songs集合的第五个元素的title的值
#{'This is a test'[3]}
获取字符串中第四个字符,即s
#{jukebox.songs.?[artist eq 'Aerosmith']}
获取集合songs中artist=’Aerosmith’的所有歌曲,得到集合的一个子集
#{jukebox.songs.^[artist eq 'Aerosmith']} //获取集合songs中artist='Aerosmith'的第一首歌曲#{jukebox.songs.$[artist eq 'Aerosmith']} //获取集合songs中artist='Aerosmith'的最后一首歌曲#{jukebox.songs.![title]}//获取title投影到一个新的String集合中#{jukebox.songs.?[artist eq 'Aerosmith'].![title]}//获取Aerosmith所有歌曲的title列表
阅读全文
0 0
- spel表达式
- SpEL表达式
- SpEl表达式
- SpEL表达式
- SpEL表达式
- Spring Security3 SpEL表达式
- Spring SpEL表达式
- SPEL-Spring表达式
- spring的SpEl表达式
- Spring SpEL表达式
- spel表达式解析
- spring表达式语言spel
- Spring 表达式语言(SpEL)
- 初学SpEL表达式
- Spring表达式语言SpEL
- Spring 表达式语言 (SpEL)
- Spring 表达式语言:SpEL
- Spring表达式语言:SpEL
- 机器学习:单词拼写纠正器python实现
- 仿腾讯微博菜单项目总结
- C语言 判断一个数是不是素数(用函数表示)
- 如何打印乘法口诀表(.c)
- 我在读pyTorch文档(一)
- SpEL表达式
- 机器学习-LDA与PCA算法
- Python:关于爬虫(1)
- selu激活函数
- 使用Postman发送GET&POST请求
- 杭电计算机学院大学生程序设计竞赛(2017新生赛)
- maven 配置多个仓库
- 2017.11.26
- org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction cannot be cast to javax.transaction.T