I need to register a custom ELResolver
for a Google App Engine project.
Since it must be registered before any request is received, as specified by the Javadoc:
It is illegal to register an ELResolver after the application has received any request from the client. If an attempt is made to register an ELResolver after that time, an IllegalStateException is thrown.
I'm using a ServletContextListener:
public class RegisterCustomELResolver implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sce) {
ServletContext context = sce.getServletContext();
JspApplicationContext jspContext =
JspFactory.getDefaultFactory().getJspApplicationContext(context);
jspContext.addELResolver(new MyELResolver());
}
...
}
The problem is that JspFactory.getDefaultFactory()
returns always null. I've alreay filled a bug report. Any idea for a workaround?