Spring Expression Language (SpEL) is not working when hyphen is used
问题 I am trying to parse an expression by using Spring Expression Language. if myVariable value is set to "first-name" (value with hyphen) then getting class.org.springframework.expression.spel.SpelParseException . ExpressionParser parser = new SpelExpressionParser(); String parsedDynamicVariablesValue = parser.parseExpression("#" + myVariable).getValue(stdContext, String.class); how to solve issue with the hyphen? Reference Used: Spring Expression Language (SpEL) 回答1: It doesn't work that way,