spring @PathVariable:请求路径url 上有变量值,可以通过@PathVariable来获取

请求路径url 上有个变量值,可以通过@PathVariable来获取  


示例:id为变量值:@RequestMapping(value = "/page/{id}", method = RequestMethod.GET)                


Tool tool = new Tool();

tool.setUrls(new String[]{"finance/account/loanDownExcel/cur","finance/account/loanDownExcel/all"});



@RequestMapping("accountlog/loanDownExcel/{type}")
public void exportAccountLogExcel(@PathVariable("type")  String type)throws Exception {}
或者是

public void exportAccountLogExcel(@PathVariable   String type)throws Exception {}

你可能感兴趣的:(框架讲解,spring)