@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值

@RequestMapping("show/{id}/{name}")
    public ModelAndView test01(@PathVariable("id") Long ids ,@PathVariable("name") String names){
         ModelAndView model= new ModelAndView();
        model.addObject("msg","占位符映射:id:"+ids+";name:"+names);
        model.setViewName("hello2");
        return model;
    }

Last modification:August 1, 2019
如果觉得这篇技术文章对你有用,请随意赞赏