SpringBoot整合小结
一.当页面调不出来
- 注意在配置文件中声明页面文件夹位置 ;例如:
#模板加载后缀
spring.freemarker.suffix=.html
spring.freemarker.template-loader-path=classpath:/Views/
- 同时在controller中如下类似即可;
@Controller
public class ViewController {
@GetMapping("index")
public String index(HttpServletRequest request){
request.setAttribute("ctx",request.getContextPath());
System.out.println("SYH===========");
return "/index";
}
}