Thymeleaf后台傳值讀取


 

 

 

/**
 * 測試用Controller
 *
 * @author
 * @date 2019-08-15
 */
@Controller
@RequestMapping("/danyu/test")
public class DanyuTestController extends BaseController
{
    private String prefix = "danyu/test";


    @RequiresPermissions("danyu:test:view")
    @GetMapping()//@RequestMapping(method = RequestMethod.GET)
    public String test(Map<String,Object> model)
    {
        model.put("ttttttt", "我是你大爺啊啊");
        model.put("aaaaaaa", "123");
        return prefix + "/test";
    }

    
}

 

 

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<head>
    <th:block th:include="include :: header('愛上對方')" />
</head>
  <body>
    <span th:text="${ttttttt}">Sebastian</span>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
            
    </script>
  </body>
</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM