首页>代码>spring boot集成beetl极简入门实例>/springboot-beetl/src/main/java/com/simon/springbootbeetl/controller/HelloBeetlController.java
package com.simon.springbootbeetl.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; /** * @author simon */ @Controller @RequestMapping("/home") public class HelloBeetlController { private static Logger logger = LoggerFactory.getLogger(HelloBeetlController.class); /** * 测试beetl模板 * * @return */ @RequestMapping("/test") public ModelAndView home() { ModelAndView modelAndView = new ModelAndView(); logger.info("test request"); modelAndView.addObject("email", "simon@qq.com"); modelAndView.setViewName("test"); return modelAndView; } }