EL configuration functions
From Resin 3.0
(Redirected from Configuration EL Library)
This article requires cleanup and may refer to a legacy version of Resin.
Please visit http://www.caucho.com/documentation/ for the most up-to-date documentation. |
Resin 3.0.14 has added the capability of adding functions to the resin.conf EL expressions.
The builtin functions are:
- class_exists - test if the class is loadable
- jndi_lookup - perform a jndi lookup of the name
- jndi - shorthand for jndi_lookup
The standard configuration library is com.caucho.config.lib.ResinConfigLibrary.
Libraries are configured using the standard META-INF/services convention.
First, create a Java class with static methods you'd like to create as a library.
Then create a META-INF/services/com.caucho.config.ConfigLibrary
file:
com.caucho.config.ConfigLibrary file
com.foo.MyLibrary
For example, you could create an add
method:
package com.foo; public class MyLibrary { public static int add(int a, int b) { return a + b; } }
Then, in your resin.conf you could use EL expressions like "${add(3, 17)}"