注解
来源:互联网 发布:mac更新flash插件 编辑:程序博客网 时间:2024/05/18 03:10
@controller
http请求
@RestController
相当于 @ResponseBody @Controller
@RequestMapping 配置url
spring-boot-starter-thymeleaf
@RequestMapping(value={"/hello","/hi"},method=RequestMethod.GET)
get post要加上处理不同的业务
可以给class加@RequestMapping
然后里面要加url上面要加
@PathVariable 获取url路径中的数据
@RequestParam 获取请求参数的值
@GetMapping 组合注解
@RequestMapping(value="/say",method = RequestMethod.GET)public String sayid(@PathParam("id") Integer id)
/say?id=xxxxx
@RequestMapping(value="/hello/{id}",method = RequestMethod.GET)public String say(@PathVariable("id") Integer id)/hello/33232
public String saym(@RequestParam(value = "id",required = false, defaultValue="0") Integer id)
@GetMapping
@PostMapping
阅读全文
0 0
- 注解
- 注解
- 注解
- 注解
- 注解
- 注解
- 注解
- 注解
- 注解
- 注解
- 注解
- 注解
- 注解
- 注解。
- 注解
- 注解
- 注解
- 注解
- Win10系统80端口被System占用 造成Apache不能启动的解决办法
- Jmeter代码的maven化
- 模板方法模式
- CF 892D Gluttony 构造
- 杭电ACM部分题目分类
- 注解
- python数据分析(统计学和线性代数)
- Activity中通过bindService启动Service
- Xshell连接不上Ubuntu解决方式
- 游戏开发-GM系统的设计
- 程序图标已经改变,但是桌面的图标没有改变清除重建桌面缓存即可
- React学习笔记_从create-react-app学习webpack
- JavaShowAlgorithm-hanoi的递归和非递归
- c#注释