V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
jwh199588
V2EX  ›  问与答

spring el 表达式的问题

  •  
  •   jwh199588 · Sep 7, 2019 · 1738 views
    This topic created in 2433 days ago, the information mentioned may be changed or developed.

    ExpressionParser parser = new SpelExpressionParser(); StandardEvaluationContext context = new StandardEvaluationContext(); String expression = "#q123"; Record datas = new Record(); datas.put("q123",123); datas.put("q12",12); context.setRootObject(datas); System.out.println(parser.parseExpression(expression).getValue(context)); 为什么这种方式取不到值,表达式该怎么写好

    1 replies    2019-09-07 11:52:08 +08:00
    XJohn
        1
    XJohn  
       Sep 7, 2019 via iPhone
    试试#[datas].’p123’
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3330 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 11:36 · PVG 19:36 · LAX 04:36 · JFK 07:36
    ♥ Do have faith in what you're doing.