ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 3.8 Nutz集成 maven: ```xml <dependency> <groupId>com.ibeetl</groupId> <artifactId>nuts</artifactId> <version>3.14.1.RELEASE</version> </dependency> ``` > 源码地址 https://gitee.com/xiandafu/beetl/tree/master/beetl-classic-integration/nuts Nutz集成提供了 BeetlViewMaker ,实现了 ViewMaker方法,如下代码 ```java @At("/ctx") @Ok("beetl:ctx.btl") public Context withContext() { Context ctx = Lang.context(); Pager pager = dao.createPager(1, 20); pager.setRecordCount(dao.count(UserProfile.class)); List<UserProfile> list = dao.query(UserProfile.class, null, pager); ctx.set("pager", pager); ctx.set("list", list); return ctx; } ``` ```xml <html> <head> <title>Beetl&Nutz</title> </head> <body> <p>总共 ${list.~size}<p/> <% for(user in list){ %> <p>hello,${user.nickname};<p/> <% } %> <p>当前页${pager.pageNumber},总共${pager.pageCount}页<p/> </body> </html> ```