我有一个如下所示的休息控制器设置
@RequestMapping(value = {"getDataFromSpaceForType/{gridName}/{spaceName}/{dataType}/{fieldNames}/{criteria}"}, method = GET, produces = "application/json")
public EntriesForTypeName getDataFromSpaceForType(@PathVariable Map<String, String> dataRequestVariables) throws Exception {
最后一个字段条件可以包含多个正斜杠。我无法处理这种情况。它打破了404错误
此外,我不知道可能会出现多少斜线,因此无法创建多种方法。
答案 0 :(得分:0)
如果您知道您的网址可能包含斜杠,那么您只需在发送/使用网址之前对网址进行编码。
如果您的前端是angularJS,那么您可以这样做:
How to generate url encoded anchor links with AngularJS?
或者如果您使用jquery: