Announcement Announcement Module
Collapse
No announcement yet.
SPeL doesn't appear to handle inline lists Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SPeL doesn't appear to handle inline lists

    In the Spring 3.0.5 doc, in the "Inline lists" section, there is an example like this:

    Code:
    // evaluates to a Java list containing the four numbers
    List numbers = (List) parser.parseExpression("{1,2,3,4}").getValue(context);
    List listOfLists = (List) parser.parseExpression("{{'a','b'},{'x','y'}}").getValue(context);
    I tried an even simpler version of this, just:
    Code:
    Expression expr = parser.parseExpression("{1,2,3,4}");
    This fails with:
    Code:
    java.lang.IllegalStateException: Cannot handle (123) '{'
    	org.springframework.expression.spel.standard.Tokenizer.process(Tokenizer.java:187)
    	org.springframework.expression.spel.standard.Tokenizer.<init>(Tokenizer.java:47)
    	org.springframework.expression.spel.standard.InternalSpelExpressionParser.doParseExpression(InternalSpelExpressionParser.java:109)
    	org.springframework.expression.spel.standard.SpelExpressionParser.doParseExpression(SpelExpressionParser.java:56)
    	org.springframework.expression.spel.standard.SpelExpressionParser.doParseExpression(SpelExpressionParser.java:1)
    	org.springframework.expression.common.TemplateAwareExpressionParser.parseExpression(TemplateAwareExpressionParser.java:66)
    	org.springframework.expression.common.TemplateAwareExpressionParser.parseExpression(TemplateAwareExpressionParser.java:56)
    Am I missing something?

  • #2
    Never mind. It looks like I had Spring 3.0.3 artifacts being deployed instead of 3.0.5. Once I made sure I had 3.0.5, this worked fine.

    Comment

    Working...
    X