spring mvc中的@PathVariable[动态参数类似于spring中的通配符功能]
来源:互联网 发布:返利网程序源码 编辑:程序博客网 时间:2024/06/15 15:45
文章来源:http://jackyrong.iteye.com/blog/2059307
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";
- }
- }
0 0
- spring mvc中的@PathVariable[动态参数类似于spring中的通配符功能]
- 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 中的参数绑定
- Spring中的通配符
- Spring MVC 05 - @PathVariable
- Spring MVC PathVariable
- Spring MVC @PathVariable注解
- Spring MVC PathVariable注解
- iOS开发-数据选择UIPickerView(案例二)
- 安卓 防止Bitmap产生OOM(OutOfMemoryError)错误
- hdu 2717 解题报告
- 管理上的小感悟
- iOS开发-数据选择UIPickerView(案例三)
- spring mvc中的@PathVariable[动态参数类似于spring中的通配符功能]
- 【图像处理】SFR算法详解2
- markdown使用haroopad导出PDF
- imagettftext(): any2eucjp(): invalid code in input string
- CodeForces 361D Levko and Array(二分+dp)
- 查找 - 《数据结构1000 + 大话数据结构》-练习题
- android 自定义对话框
- Python OOP知识积累
- Jpeglib读取jpg文件