[ 
https://issues.apache.org/jira/browse/EL-8?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12521052
 ] 

Henri Yandell commented on EL-8:
--------------------------------

Note - the attached test is copyright'd to Jamie, so while we can use it to 
confirm the bug and confirm the fix (if thus found), we shouldn't commit it.

I can confirm that the test does indeed fail. It makes sense as a bug, but I 
can't figure out a way to pass it. 

The bug is because the private JSTLExpression class, a subclass of the JSP spec 
Expression class (not a part of EL), does not clone the function mapper when it 
is created. The API for the FunctionMapper is very sparse, just a single lookup 
method, so cloning is not an option.

It might be possible to ask the parsedExpression for the functions it contains, 
and look them up when the JSTLExpression is created, and create a new 
JSTLFunctionMapper that may be used. The parsedExpression is an Object, so 
that's fraught with some difficulty.

> [el] Implementation of parseExpression does not implement spec
> --------------------------------------------------------------
>
>                 Key: EL-8
>                 URL: https://issues.apache.org/jira/browse/EL-8
>             Project: Commons EL
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: Operating System: All
> Platform: All
>            Reporter: Jamie Taylor
>             Fix For: 1.1
>
>         Attachments: function-binding.txt, TestFunctionBinding.java
>
>
> The implementation of parseExpression in the EL expression evaluator does not 
> conform to the JSP 2.0 specification.  The javadoc for the fMapper argument 
> states that 
> "The ExpressionEvaluatormustnotholdontotheFunctionMapperreferenceafter 
> returning fromparseExpression(). TheExpression object returned must invoke 
> the same functions regardless of whether the mappings in the 
> providedFunctionMapper instance change between calling 
> ExpressionEvaluator.parseExpression() andExpression.evaluate()."
> The test case which I will attach clearly shows that this is not the case.
> Why hasn't anybody noticed this before, you may ask?  I suspect that the 
> current implementation of Tomcat never updates the bindings in its function 
> mapper once one is constructed, since the functions are defined at web-app 
> load time and can't be updated after that.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to