真的想吐槽一下,浪费我时间:由此可见访问路径是没错的:
@Controller
@RequestMapping("/pay")
public class payController {
@Autowired
private OrderService orderService;
@GetMapping("/create")
public ModelAndView create() throws UnsupportedEncodingException {
return new ModelAndView("pay/haha");
}
}
原因:
版本问题,SpringBoot版本升级后,他的默认后缀不再是ftl
,而是ftlh
如果还想用ftl
,需要在application.properties文件中配置:
spring.freemarker.suffix=.ftl