Home  >  Forum  >  Spring
Post New Query

parsing a valid expression, there is still more data in expression


joined on
August 15,2013
Asked on October 04,2013
I am using Spring Expression language (SPEL) and created a sample program. The code snippet is 

ExpressionParser parser = new SpelExpressionParser();
Expression exp = parser.parseExpression("You are Here");

But got below error.


Exception in thread "main" org.springframework.expression.spel.SpelParseException: EL1041E:(pos 4): After parsing a valid expression, there is still more data in the expression: 'are'
at org.springframework.expression.spel.standard.InternalSpelExpressionParser.doParseExpression(InternalSpelExpressionParser.java:86)
at org.springframework.expression.spel.standard.SpelExpressionParser.doParseExpression(SpelExpressionParser.java:56)
at org.springframework.expression.spel.standard.SpelExpressionParser.doParseExpression(SpelExpressionParser.java:32)
at org.springframework.expression.common.TemplateAwareExpressionParser.parseExpression(TemplateAwareExpressionParser.java:66)
at org.springframework.expression.common.TemplateAwareExpressionParser.parseExpression(TemplateAwareExpressionParser.java:56)

Any suggestion?
joined on
May 11,2013
Replied on October 04,2013

In SpEL while parsing string(with more than one word) enclose it with single quote(') .
Do it like

Expression exp = parser.parseExpression("'You are Here'");

Write Answer



Sitewide-Feb4of4234x60





Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us