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.
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.
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.
Bean | Class | Description |
---|---|---|
request | ch.nevis.esauth.auth.engine.AuthRequest | Request object of nevisAuth.Invocation of some methods is forbidden for security reasons. |
response | ch.nevis.esauth.auth.engine.AuthResponse | Response object of nevisAuth.Invocation of some methods is forbidden for security reasons. |
sess | java.util.Map | The user session. |
inctx | java.util.Properties | Incoming context values, as provided by the client. |
inargs | java.util.Properties | Input parameters provided by the user |
outargs | java.util.Properties | Output value to send to the client. |
notes | java.util.Properties | Short-term notes pertaining to the current request/response iteration. |
litdict | java.util.ResourceBundle | Literal dictionary for the user's language. Cannot be used if useLiteralDictionary was set to false in the AuthEngine configuration. |
property | java.util.Properties | Java system properties. |
oocd | ch.nevis.esauth.ooc.OutOfContextDataService | The singleton instance of the OutOfContextDataService which allows to store data outside of the user's context. |
Arrays | java.util.Arrays | Helper classes whose static methods may be invoked like regular bean methods. |
Collections | java.util.Collections | |
Math | java.lang.Math | |
Locale | java.util.Locale | |
String | java.lang.String | |
Integer | java.lang.Integer | |
Long | java,lang.Long | |
BigInteger | java.math.BigInteger | |
Float | java.lang.Float | |
Boolean | java.lang.Boolean | |
StringUtils | org.apache.commons.lang.StringUtils | Helper classes from the Apache Commons library whose static methods may be invoked like regular bean methods. |
StringEscapeUtils | org.apache.commons.lang.StringEscapeUtils | |
DateTimeFormatter | java.time.format.DateTimeFormatter | |
Instant | java.time.Instant | |
LocalDate | java.time.LocalDate | |
LocalDateTime | java.time.LocalDateTime | |
LocalDateTime | java.time.LocalDateTime | |
OffsetDateTime | java.time.OffsetDateTime | |
ZoneOffset | java.time.ZoneOffset | |
ZoneId | java.time.ZoneId | |
ChronoUnit | java.time.temporal.ChronoUnit | |
Duration | java.time.Duration | |
PhoneNumberUtil | com.google.i18n.phonenumbers.PhoneNumberUtil | Helper classes from he libphonenumber library that support parsing and formatting of phone numbers from/to strings. |
PhoneNumberFormat | com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat | |
AuthConst | ch.nevis.esauth.auth.engine.AuthConst | Helper classes of nevisAuth whose static methods may be invoked like regular bean methods. |
CertificateUtil | ch.nevis.esauth.util.CertificateUtil | |
PwGetter | ch.nevis.esauth.util.PwGetter | |
ELUtils | ch.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 Date Handling Changes for detailed examples.