posts - 431,  comments - 344,  trackbacks - 0
公告
 Don't Repeat Yourself
座右铭:you can lose your money, you can spent all of it, and if you work hard you get it all back. But if you waste your time, you're never gonna get it back.
公告本博客在此声明部分文章为转摘,只做资料收集使用。


微信: szhourui
QQ:109450684
Email
lsi.zhourui@gmail.com
<2016年5月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

留言簿(15)

随笔分类(1019)

文章分类(3)

文章档案(21)

收藏夹

Link

好友博客

最新随笔

搜索

  •  

积分与排名

  • 积分 - 855802
  • 排名 - 47

最新评论

阅读排行榜

@RequestParam注解用于在控制器中绑定请求参数到方法参数.
用法如下:
@RequestMapping
 public void advancedSearch(
   @RequestParam("queryStr") String queryStr,
   @RequestParam("showFlag") String showFlag,
   @RequestParam("totalnumber") String totalNumber,
   @RequestParam("upType") String upType,
   @RequestParam("jmesareq") String jmesaReq,
   @RequestParam("isExportOper") String isExportOper,

   HttpServletResponse response, final HttpServletRequest request,
   ModelMap model) {
  // get query structure and query type from page
  List<Long> cd_ids = new ArrayList<Long>();
  if(StringUtils.equals("invoke", jmesaReq)){
   cd_ids = (List<Long>)request.getSession().getAttribute(Constants.RESULT_IDS);
  }
 ....
 }

使用这个注解参数默认是必需的, 但是可以把@RequestParam的required属性设置为false从而让这个参数可选.
例如@RequestParam(value="name", required="false")
posted on 2009-03-17 16:26 周锐 阅读(11682) 评论(2)  编辑  收藏 所属分类: Spring

只有注册用户登录后才能发表评论。


网站导航: