freemarker 模板报错

来源:6-1 SpringBoot 整合freemarker

yahibo

2018-06-25 17:23

@Controller

@RequestMapping("ftl")

public class IndexController {

    @Autowired    

    private Resource resource;

    @RequestMapping("/index")

    public String index(ModelMap map) {

        map.addAttribute("resource", resource);

            return "index";

        }

}


freemarker 模板报错 

Description: Field resource in com.hibo.controller.IndexController required a bean of type 'org.springframework.core.io.Resource' that could not be found.

Action: Consider defining a bean of type 'org.springframework.core.io.Resource' in your configuration.



写回答 关注

2回答

  • 虹晔
    2019-03-23 18:19:13

    我也是这个错误,这个你怎么解决的

  • yahibo
    2018-06-25 18:06:19

    问题解决

SpringBoot开发常用技术整合

SpringBoot 极简开发的框架整合利器

102172 学习 · 508 问题

查看课程

相似问题