1.SpringBoot默认解析文件类型为ftl的文件;
2.在控制器中,如请求路径和返回值一致时,会陷入死循环;
3. 变换url路径
在get请求中返回hello,
在另一控制中有/hello,则会跳转为/hello,故返回和请求路径避免一致
@Controller
public class getcontroller {
@RequestMapping("/login1")
public String hello(Model m)
{ m.addAttribute(“name”, “thymeleaf”);
return “hello”; } }
@RestController
public class webController {
@RequestMapping("/hello")
public String hello() {
return “Hello Spring Boot!!!2019610”; } }