Skip to main content
Version: 7.2402.x.x RR

Java EL expressions

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

EL and variable expressions

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 the Jakarta EL Specification for an in-depth introduction. However, the details of the usage of Java EL may differ from the usage patterns in nevisAuth.

info

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 5.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.
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
DateTimeFormatterjava.time.format.DateTimeFormatter
Instantjava.time.Instant
LocalDatejava.time.LocalDate
LocalDateTimejava.time.LocalDateTime
LocalDateTimejava.time.LocalDateTime
OffsetDateTimejava.time.OffsetDateTime
ZoneOffsetjava.time.ZoneOffset
ZoneIdjava.time.ZoneId
ChronoUnitjava.time.temporal.ChronoUnit
Durationjava.time.Duration
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

Date handling

nevisAuth EL expression rely on the java.time API to parse and do operation on dates. An overview of the java.time API is available in the official documenation.

The table above describes which java.time classes are available in nevisAuth EL expressions.

Standard date formats handled by Java can be found in the official documentation, including formatting.

Visit Appendix J for detailed examples.