Writing a custom EL resolver
EL flexibility can be tested by extending it with custom implicit variables, properties, and method calls. This is possible if we extend the VariableResolver
or PropertyResolver
class, or even better, the ELResolver
class that give us flexibility to reuse the same implementation for different tasks. The following are three simple steps to add custom implicit variables:
- Create your own class that extends the
ELResolver
class. - Implement the inherited abstract methods.
- Add the
ELResolver
class infaces-config.xml
.
Next, you will see how to add a custom implicit variable by extending EL based on these steps. In this example, you want to retrieve a collection that contains the ATP singles rankings using EL directly in your ...
Get Mastering JavaServer Faces 2.2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.