spring mvc中的@PathVariable
来源:互联网 发布:博雅软件上市吗 编辑:程序博客网 时间:2024/06/02 03:31
spring mvc中的@PathVariable是用来获得请求url中的动态参数的
@Controller public class TestController { @RequestMapping(value="/user/{userId}/roles/{roleId}",method = RequestMethod.GET) public String getLogin(@PathVariable("userId") String userId, @PathVariable("roleId") String roleId){ System.out.println("User Id : " + userId); System.out.println("Role Id : " + roleId); return "hello"; } @RequestMapping(value="/product/{productId}",method = RequestMethod.GET) public String getProduct(@PathVariable("productId") String productId){ System.out.println("Product Id : " + productId); return "hello"; } @RequestMapping(value="/javabeat/{regexp1:[a-z-]+}", method = RequestMethod.GET) public String getRegExp(@PathVariable("regexp1") String regexp1){ System.out.println("URI Part 1 : " + regexp1); return "hello"; } }
(原文链接:http://jackyrong.iteye.com/blog/2059307)
0 0
- spring mvc中的@PathVariable
- spring mvc中的@PathVariable
- spring mvc中的@PathVariable
- spring mvc中的@PathVariable
- spring mvc中的@PathVariable
- spring mvc中的@PathVariable
- spring mvc中的@PathVariable
- Spring MVC中的@PathVariable
- Spring MVC 中的 @ResponseBody,@RequestBody,@PathVariable
- spring mvc中的@PathVariable(转载)
- spring mvc中的@PathVariable的使用场景
- Spring MVC 05 - @PathVariable
- Spring MVC PathVariable
- Spring MVC @PathVariable注解
- Spring MVC PathVariable注解
- spring mvc @PathVariable和@RequestParam
- Spring MVC @RequestParam与@PathVariable
- spring mvc中的@PathVariable[动态参数类似于spring中的通配符功能]
- Atomic
- mysql 黑窗口连接数据库以及常用数据类型
- 微信小程序开发学习笔记004--微信小程序语法结构
- 计算机网络体系结构——各层的功能
- js取地址栏参数且防止中文乱码
- spring mvc中的@PathVariable
- 编译caffe出现错误:make: *** [.build_release/src/caffe/common.o] Error 1
- android developer tiny share-20170213
- scp 错误 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
- nginx搭配frp进行端口和服务转发
- node webkit(nw.js) 设置自动更新
- android 引用第三方lib工程(非单独的lib文件)需要注意的地方
- ES6学习笔记之《变量的解构赋值》
- WebView自适应实际内容高度