1.注解@pathvariable的用法
来源:互联网 发布:生活垃圾的数据 编辑:程序博客网 时间:2024/06/05 16:12
@Controllerpublic 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"; }}
@PathVariable是用来对指定请求的URL路径里面的变量
@RequestMapping(value = http://blog.csdn.net/gisredevelopment/article/details/”form/{id}/apply”, method = {RequestMethod.PUT, RequestMethod.POST})
{id}在这个请求的URL里就是个变量,可以使用@PathVariable来获取
阅读全文
0 0
- 1.注解@pathvariable的用法
- @PathVariable注解的使用
- @PathVariable注解的使用
- 笔记:各种注解的用法。@ModelAttribute, @SuppressWarnings("rawtypes"),@PathVariable
- springmvc的注解pathvariable的注解
- 2、注解@PathVariable用法——映射URL绑定的占位符
- springmvc中的@PathVariable的用法
- spring 注解@PathVariable和@RequestParam的区别
- springMVC的@RequestParam注解和@PathVariable注解的区别
- springMVC的@RequestParam注解和@PathVariable注解的区别
- springMVC的@RequestParam注解和@PathVariable注解的区别
- @ResquestMapping,@ResponseBody,PathVariable,@ResquestParam的用法
- Spring @PathVariable注解
- springmvc之@PathVariable注解
- springMVC(14)------PathVariable注解
- springmvc注解:PathVariable,
- springmvc-4,PathVariable注解
- Spring MVC @PathVariable注解
- js中eval函数对json格式数据的处理
- JavaScript实现继承的方式优化
- 基本图像操作
- Android面试必会
- JVM垃圾回收根搜索的三种算法
- 1.注解@pathvariable的用法
- 初识NodeJS服务端开发(Express+MySQL)
- Android中将图片保存到数据库中
- 2 SOLR2:SOLR整合TOMCAT+导入数据并创建索引+solrj操作
- 库存分析与控制课后习题
- 递归算法的一种理解
- 39 Anaconda
- 约瑟夫问题的四种解法
- 特征值分解