1.前端访问后台的地址为../film/show/**.html
**是所传递的参数
在后台controller应该通过如下方式进行获取
@RequestMapping("/film")
public class FilmReController
{
@RequestMapping("/show/{id}")
public ModelAndView details(@PathVariable("id")Integer id,HttpServletRequest request) throws Exception
{}
}
@PathVariable("id")Integer id 指的是参数一定会有
2.前端访问后台的地址为
.../film/show/hotFilms.html?
catId="+catId+"&typeId="+typeId+"&sortId="+sortId;
参数是通过url中?后面的进行传递的
在后台controller层应该通过如下通过如下方式进行获取
@RequestMapping("/show/hotFilms")
public ModelAndView listHotFilms(
@RequestParam(value="catId",required = false)Integer catId,
@RequestParam(value="typeId",required = false)Integer typeId,
@RequestParam(value="sortId",required = false)Integer sortId ,
HttpServletRequest request
) throws Exception
{
}
required = false指的是可以没有这个参数