Skip to content

Support letters other than A-Z in identifiers in SpEL expressions #30580

Closed
@changyoutianxia

Description

@changyoutianxia

Affects: Spring Framework 5.3.13


SpEL does not support Chinese.

Example:

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    static class Simple {
        private String 张三;
    }

    @Test
    void testSpel() {
        ExpressionParser parser = new SpelExpressionParser();
        Expression exp = parser.parseExpression("张三 == null ? 'World' : 张三");
        Simple rootObject = new Simple("test");

        Object value = exp.getValue(rootObject);
        System.out.println(value);

    }

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions