企业🤖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> ```