3.向Session域共享数据

 //向Session域共享数据
    @RequestMapping("/testSession")
    public String testSession(HttpSession session){
        session.setAttribute("testSessionScope","hello,Session");
        return "success";
    }
<a th:href="@{/testSession}">通过ServletAPI向Session域共享数据</a><br><br><br>
<p th:text="${session.testSessionScope}"></p><br><br><br>

 

posted @ 2021-08-23 20:02  L1998  阅读(42)  评论(0)    收藏  举报