Freemarker获取pojo属性
生活随笔
收集整理的這篇文章主要介紹了
Freemarker获取pojo属性
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
獲取pojo屬性
${key.property}
通過點,獲取屬性
數據集
//6.創建一個數據集,可以是pojo也可以是map,推薦使用map Map data = new HashMap<>(); Student student = new Student(1, "小米", 11, "北京昌平回龍觀"); data.put("student", student);模板
<html> <head><title>測試頁面</title> </head> <body>學生信息:<br>學號:${student.id}<br>姓名:${student.name}<br>年齡:${student.age}<br>家庭住址:${student.address}<br> </body> </html>總結
以上是生活随笔為你收集整理的Freemarker获取pojo属性的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Freemarker使用
- 下一篇: Freemarker循环遍历