jwh199588
V2EX  ›  问与答

spring el 表达式的问题

  •  
  •   jwh199588 · Sep 7, 2019 · 1803 views
    This topic created in 2454 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   ·   4318 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 00:09 · PVG 08:09 · LAX 17:09 · JFK 20:09
    ♥ Do have faith in what you're doing.