Is there a way to populate a map in JSP?

前端 未结 1 1226
误落风尘
误落风尘 2021-01-19 00:49

For example


// need somehow do something like this: total.put(\'key\', \'value\');


        
相关标签:
1条回答
  • 2021-01-19 01:40

    You can use JSTL <c:set> for this.

    <jsp:useBean id="total" class="java.util.LinkedHashMap"/>
    <c:set target="${total}" property="key" value="value" />
    
    0 讨论(0)
提交回复
热议问题