示例代码:
/*@ResponseBody

@Controller*/
@RestController
public class HelloController {
@RequestMapping("/hello")
public String Hello(){
return "Hello world!";
}
}
@RestController是:@ResponseBody和@Controller两个注解的合体
标注在类上,表示:这个Controller类的所有方法返回的数据直接写给浏览器。

相关文章:

  • 2022-01-11
  • 2022-12-23
  • 2021-12-29
  • 2021-12-08
  • 2022-12-23
  • 2021-09-05
  • 2021-12-01
  • 2021-06-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-12-24
相关资源
相似解决方案