【问题标题】:Spring mvc with thymeleaf带有百里香叶的 Spring mvc
【发布时间】:2016-03-16 10:17:57
【问题描述】:

如何使用 thymeleaf 添加一个没有任何 pojos 的 String 对象?

@RequestMapping("/hello")
public String s(Model model){
    model.add("e","model test");
    return "view1";
}

接下来如何从视图中获取数据?!

【问题讨论】:

    标签: spring model-view-controller thymeleaf


    【解决方案1】:

    这些在Thymeleaf docs里解释的很好,你看过了吗?

    <p th:text="${e}">1</p>
    

    【讨论】:

    • 谢谢,但我知道要显示给谁...... ModelAttribute String , 模型模型)
    猜你喜欢
    • 2015-06-01
    • 2020-05-17
    • 2017-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-02
    • 2013-11-26
    • 1970-01-01
    相关资源
    最近更新 更多