Getting Started

The JUEL distribution contains the following JAR files:

  1. juel-api-2.2.x.jar - contains the javax.el API classes.
  2. juel-impl-2.2.x.jar
  3. juel-spi-2.2.x.jar
  1. Factory and Context

    // the ExpressionFactory implementation is de.odysseus.el.ExpressionFactoryImpl
    ExpressionFactory factory = new de.odysseus.el.ExpressionFactoryImpl(); // package de.odysseus.el.util provides a ready-to-use subclass of ELContext
    de.odysseus.el.util.SimpleContext context = new de.odysseus.el.util.SimpleContext();
  2. Functions and Variables
    // map function math:max(int, int) to java.lang.Math.max(int, int)
    context.setFunction("math", "max", Math.class.getMethod("max", int.class, int.class)); // map variable foo to 0
    context.setVariable("foo", factory.createValueExpression(0, int.class));
  3. Parse and Evaluate
    // parse our expression
    ValueExpression e = factory.createValueExpression(context, "${math:max(foo,bar)}", int.class); // set value for top-level property "bar" to 1
    factory.createValueExpression(context, "${bar}", int.class).setValue(context, 1); // get value for our expression
    System.out.println(e.getValue(context)); // --> 1

Juel Getting Started的更多相关文章

  1. Juel 表达式使用

    JUEL 包的结构例如以下: 1.1.1. Juel maven仓库配置 眼下最新的版本号是2.2.7.使用的时候在pom.xml中加入仓库坐标就可以. <dependency> < ...

  2. 异常:java.lang.LinkageError: loader constraint violation: when resolving interface method

    异常:java.lang.LinkageError: loader constraint violation: when resolving interface method "javax. ...

  3. 研究base64_encode的算法

    从网上看了一些资料,为了方便自己理解,于是把它的编码原理,自己放在excel表格中清晰列出来,方便以后查阅.做的图如下:

  4. Tomcat6环境JBPM4.4报错:java.lang.ClassNotFoundException: de.odysseus.el.util.SimpleResolver

    Tomcat6环境JBPM4.4报错:java.lang.ClassNotFoundException: de.odysseus.el.util.SimpleResolver 报错信息:

  5. SSH整合JBPM4.4

    第一步:导入所需jar包: 所需的jar包(使用了hibernate annotation和struts2的convention-plugin,可能有多余的包,没做清理): 第二步:修改jbpm配置文 ...

  6. Jbpm4.4+hibernate3.5.4+spring3.0.4+struts2.1.8整合例子(附完整的请假流程例子,jbpm基础,常见问题解决)

    Jbpm4.4+hibernate3.5.4+spring3.0.4+struts2.1.8 整合例子(附完整的请假流程例子). 1.jbpm4.4 测试环境搭建 2.Jbpm4.4+hibernat ...

  7. Java框架----SSH整合回顾

    1,新建工程,类型为Web Project,设置默认编码为UTF-8,并创建如下文件夹 1,Source Folder 1,src 项目源码 2,config 配置文件 3,test 单元测试 2,普 ...

  8. BPMN2新规范与Activiti5

    上世纪九十年代以后,随着WfMC联盟的成立,BPM市场群雄逐鹿如火如荼,工作流技术得到了突飞猛进的发展,其中IBM.Oracle等大型软件厂商在工作流领域各扯大旗割据一方.2011年BPMN2.0新规 ...

  9. JBPM4.4部署到tomcat6异常解决办法

    java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.ser ...

随机推荐

  1. [转]如何清空Chrome缓存和Cookie

    当您使用浏览器(例如 Chrome)时,浏览器会将网站中的一些信息保存在其缓存和 Cookie 中. 清除这些内容可以解决某些问题,例如网站上的加载或格式设置问题. 在 Chrome 中 在计算机上打 ...

  2. System.NullReferenceException:未将对象引用设置到对象的实例,这是一个新鸟,中鸟,老鸟都避不开的错误

    原文链接:http://www.jb51.net/article/30005.htm

  3. homework5 for java

  4. Spark+Python+Pycharm在Windows下的配置

    http://blog.csdn.net/ydq1206/article/details/51922148

  5. [BZOJ3196][Tyvj1730]二逼平衡树

    [BZOJ3196][Tyvj1730]二逼平衡树 试题描述 您需要写一种数据结构(可参考题目标题),来维护一个有序数列,其中需要提供以下操作: 查询 \(k\) 在区间内的排名 查询区间内排名为 \ ...

  6. [NOI.AC省选模拟赛3.23] 染色 [点分治+BFS序]

    题面 传送门 重要思想 真的是没想到,我很久以来一直以为总会有应用的$BFS$序,最终居然是以这种方式出现在题目中 笔记:$BFS$序可以用来处理限制点对距离的题目(综合点分树使用) 思路 本题中首先 ...

  7. [TJOI2018]数学计算 线段树

    ---题面--- 题解: ,,,考场上看到这题,没想到竟然是省选原题QAQ,考场上把它当数学题想了好久,因为不知道怎么处理有些数没有逆元的问题....知道这是线段树后恍然大悟. 首先可以一开始就建出一 ...

  8. [Leetcode] Roman to integer 罗马数字转成整数

    Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 t ...

  9. 如何加快JavaScript的加载与执行

    JS 有个很无语的阻塞特性,就是当浏览器在执行JS 代码时,不能同时做其他任何事情,无论其代码是内嵌的还是外部的. 浏览器在碰到一个引入外部JS 文件的<script>标签时会停下所有工作 ...

  10. 深入研究JavaScript的事件机制

    本篇开始将回顾下Javascript的事件机制.同时会从一个最小的函数开始写到最后一个具有完整功能的,强大的事件模块.为叙述方便将响应函数/回调函数/事件Listener/事件handler都称为事件 ...