标签:map body ati class turn spring role string ret
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMethod;
@RestController //等同于同时加上了@Controller和@ResponseBody
public class HelloControler {
//访问/hello或者/hi任何一个地址,都会返回一样的结果
@RequestMapping(value = {"/hello","/hi"},method = RequestMethod.GET)
public String say(){
return "hi you!!!";
}
}
标签:map body ati class turn spring role string ret
原文地址:http://www.cnblogs.com/mhc-fly/p/7078330.html