Skip to content

Controller 添加

cmlbeliever edited this page Feb 19, 2017 · 1 revision
  1. 在com.cml.springboot.sample.controller包下新建类A
  2. 在类上添加注解@Controller
  3. 在类A上新建方法test
  4. 在test方法上添加@RequestMapping("/test"),@ResponseBody
@RequestMapping("/test")
	@ResponseBody
	public String test() {
		return "I am a controller";
	}
Clone this wiki locally