2007-10-05 00:53:07 UTC
I'm trying to create a simple JSP tag that will let me use JUEL expressions (specifically, method calls) in any container. The idea is something like this:
<juel:set var="foo" value="${bar.method(blah)}" />
Short of using JUEL as the EL for Tomcat (something I can't change), this seems like a straightforward and useful way of getting Velocity-style method calls into JSP pages.
Unfortunately I'm having trouble seeing how to tackle the problem. In particular, how do I get the JUEL engine to do variable resolution using the JSP context? Two approaches come to mind:
* Extend SimpleContext and have it return Tomcat's VariableMapper. Will that even work?
* Extend SimpleContext and implement my own VariableMapper. Resolve requests using the pagecontext and wrap them in ObjectValueExpressions.
Do either of those approaches sound like the right idea? Are there other issues? A little conceptual assistance would save me a lot of trial-and-error.
Thanks,
Jeff