@RestController
@RequestMapping("/hello")
public class HelloController {
/* @Value("${cupSize}")
private String cupSize;
@Value("${age}")
private int age;
@Value("${content}")
private String content;*/
@Autowired
private GirlProperties girlProperties;
@GetMapping("/say/${id}")
public String say(@PathVariable("id")Integer id){
//return girlProperties.getCupSize();
//return "index";
return "id: " + id;
}
}
2 回答
已采纳
chandou
TA贡献22条经验 获得超11个赞
@GetMapping("/say/${id}")更改为@GetMapping("/say/{id}")
@GetMapping("/say/{id}") public String say(@PathVariable("id") Integer id) { return "id=" + id; }
- 2 回答
- 0 关注
- 2742 浏览
添加回答
举报
0/150
提交
取消