Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.springframework.expression: Bug in TemplateAwareExpressionParser when expressionString contains '}' [SPR-5438] #10112

Closed
spring-projects-issues opened this issue Jan 27, 2009 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Oliver Becker opened SPR-5438 and commented

I have a scenario where the expressionString that is to be parsed by the TemplateAwareExpressionParserf is a Javascript snippet that contains an expression. This script especially has closing braces after the expression

Something like
"{ var val = '${foo.bar}'; }"

The final method parseExpressions() has this part in it

} else {
     // another expression exists after this one in the expression string
     suffixIndex = expressionString.lastIndexOf(suffix, nextPrefixIndex);
}

(suffix is context.getExpressionSuffix() and evaluates to "}")

Apparently, when the expressionString contains a single } which does not belong to the expression, then the parser identifies the wrong substring as the expression to be parsed
(in this case the part "foo.bar}'; "), so the following expression parsing in doParseExpression() throws an exception.


Affects: 3.0 M1

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This is fixed now, as part of a general revision of template expression handling in 3.0 M2.

Out of curiosity: Where are you using Spring's expression parser there - from a web view template?

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants