【问题标题】:iterate over spring:message迭代 spring:message
【发布时间】:2011-11-27 16:09:13
【问题描述】:

有什么方法可以遍历 spring:message 吗?我有一些这样的属性:

ajax.title = foobaa
ajax.content = some content

并尝试获得这样的输出:

{"title" : "foobaa", "content" : "some content"}

【问题讨论】:

    标签: spring iteration message


    【解决方案1】:

    Spring 消息存储在 Map 中。不做一些工作就无法得到你想要的输出,但是你可以得到 Map 的toString() 方法的标准输出:

    { "ajax.title":"foobaa", "ajax.content":"some content" }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-09-26
      • 2013-05-24
      • 2011-04-01
      • 2016-02-17
      • 2021-08-24
      • 2016-10-22
      • 2019-06-04
      相关资源
      最近更新 更多