如果我在Angular 5中使用->
<a href="http://localhost:8090/ml/download/true/{{data.data}}">
我的服务器SpringBoot运行->
@RequestMapping(method = RequestMethod.GET, path = "/{download}/{data}/{nameFile}", produces = MediaType.APPLICATION_JSON_VALUE)
public void download(HttpServletResponse response, @PathVariable("data") Boolean data,
@PathVariable("nameFile") String nameFile) {
但是当我用1个数据更改URl Angular和SpringBoot时->
<a href="http://localhost:8090/ml/download/true/{{data.data}}/201801">
@RequestMapping(method = RequestMethod.GET, path = "/{download}/{data}/{nameFile}/{period}", produces = MediaType.APPLICATION_JSON_VALUE)
public void download(HttpServletResponse response, @PathVariable("data") Boolean data,
@PathVariable("nameFile") String nameFile, @PathVariable("period") String period) {
仅添加“句号”,我的SpringBoot无法接听电话。
我发现,如果我发表评论->
@RequestMapping("/**/{path:[^\\\\.]+}")
public String redirect(HttpServletResponse response) throws IOException {
return "forward:/index.html";
}
如果我评论此控制器,则可以使用/ period,但我需要此控制器。