Skip to main content
Version: 4.25.x.x LTS

Java EL expressions

nevisAuth supports the Java Expression Language (Java EL) 2.0 syntax at the same locations as variable expressions. Java EL uses the customary ${...} or #{...} syntaxes, without difference in evaluation.

In some cases, nevisAuth interprets valid Java EL expressions as variable expressions, which causes an empty result. This happens if the EL expression starts with a known variable expression source, followed by a potentially valid property name. See also Variable expressions. For example: nevisAuth will not evaluate ${notes.containsKey('test')} as an EL expression because notes is a valid variable expression source and containsKey might be the name of a custom notes property.

To prevent such confusion, use one of the following variants:

#{notes.containsKey('test')} ${ notes.containsKey('test')} (the extra space after "${" is intentional)

A full discussion of Java EL is beyond the scope of this document. See for example the Java EE Tutorial http://docs.oracle.com/javaee/6/tutorial/doc/gjddd.html/` for an in-depth introduction. However, the details of the usage of Java EL may differ from the usage patterns in nevisAuth.

See EL context beans for a list of Java beans available in EL expressions.

nevisAuth implements an extended EL engine that supports invocations of static methods and that its invocation resolver extends the specified EL invocation procedure by considering method parameter types. This allows the use of overloaded methods, varArg methods, static invocation and similar features of Java that are not supported in Java EL 2.0.EL context beans

The following table shows beans and helper classes that can be used in an EL expression in nevisAuth. See the JavaDoc documentation of the classes for a complete list of accessible methods.

BeanClassDescription
requestch.nevis.esauth.auth.engine.AuthRequestRequest object of nevisAuth.Invocation of some methods is forbidden for security reasons.
responsech.nevis.esauth.auth.engine.AuthResponseResponse object of nevisAuth.Invocation of some methods is forbidden for security reasons.
sessjava.util.MapThe user session.
inctxjava.util.PropertiesIncoming context values, as provided by the client.
inargsjava.util.PropertiesInput parameters provided by the user
outargsjava.util.PropertiesOutput value to send to the client.
notesjava.util.PropertiesShort-term notes pertaining to the current request/response iteration.
litdictjava.util.ResourceBundleLiteral dictionary for the user's language. Cannot be used if useLiteralDictionary was set to false in the AuthEngine configuration.
propertyjava.util.PropertiesJava system properties.
oocdch.nevis.esauth.ooc.OutOfContextDataServiceThe singleton instance of the OutOfContextDataService which allows to store data outside of the user's context.
nowjava.util.DateDate object holding current time.
nowJodaorg.joda.time.DateTimeJoda DateTime object holding current time.
nowCaljava.util.CalendarCalendar object holding the current time.
Arraysjava.util.ArraysHelper classes whose static methods may be invoked like regular bean methods.
Collectionsjava.util.Collections
Mathjava.lang.Math
Localejava.util.Locale
Stringjava.lang.String
Integerjava.lang.Integer
Longjava,lang.Long
BigIntegerjava.math.BigInteger
Floatjava.lang.Float
Booleanjava.lang.Boolean
StringUtilsorg.apache.commons.lang.StringUtilsHelper classes from the Apache Commons library whose static methods may be invoked like regular bean methods.
StringEscapeUtilsorg.apache.commons.lang.StringEscapeUtils
DateFormatUtilsorg.apache.commons.lang.time.DateFormatUtils
DateUtilsch.nevis.esauth.util.AuthDateUtilsExtends the Apache DateUtils for additional operations like parsing Joda DateTime and calendar objects from strings.
PhoneNumberUtilcom.google.i18n.phonenumbers.PhoneNumberUtilHelper classes from he libphonenumber library that support parsing and formatting of phone numbers from/to strings.
PhoneNumberFormatcom.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat
AuthConstch.nevis.esauth.auth.engine.AuthConstHelper classes of nevisAuth whose static methods may be invoked like regular bean methods.
CertificateUtilch.nevis.esauth.util.CertificateUtil
PwGetterch.nevis.esauth.util.PwGetter
ELUtilsch.nevis.esauth.util.el.ELUtils