标签:class and spring ice handler sturts2 app eth post
* @RequestMapping
》用于将url跟方法进行绑定,通过访问指定url执行相应的方法
@RequestMapping("/getCustList") public ModelAndView getCustList(){ List<Customer> list = customerService.getCustList(null); ModelAndView mav = new ModelAndView(); mav.addObject("list",list); mav.setViewName("/index.jsp"); return mav; }
* 窄化url映射
》说的很专业,其实就是在类上在加个url根路径,很想sturts2时的命名空间,起到类之间url管理,放置url冲突
RequestMapping("/CustomerHandler") public class CustomerHandler {}
*限制http请求类型
》@RequestMapping有一个属性method数组,可以在里面限制请求的类型
@RequestMapping(value="/getCustList",method = {RequestMethod.GET,RequestMethod.POST}) public ModelAndView getCustList(){}
标签:class and spring ice handler sturts2 app eth post
原文地址:https://www.cnblogs.com/ibcdwx/p/12991764.html