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.
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. |
now | java.util.Date | Date object holding current time. |
nowJoda | org.joda.time.DateTime | Joda DateTime object holding current time. |
nowCal | java.util.Calendar | Calendar object holding the current time. |
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 | |
DateFormatUtils | org.apache.commons.lang.time.DateFormatUtils | |
DateUtils | ch.nevis.esauth.util.AuthDateUtils | Extends the Apache DateUtils for additional operations like parsing Joda DateTime and calendar objects from strings. |
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 |