Controller 和 RestController的区别
贴一段代码 Controller =RestController+ResponseBody 如果只用Controller 不使用ResponseBody 会提示404
@Controller
public class HelloController {
@ResponseBody
@RequestMapping("/hello")
public String hello(){
return "Hello World!";
}
}
@RestController
public class HelloController {
@RequestMapping("/hello")
public String hello(){
return "Hello World!";
}
}