spring mvc截断特殊符号

时间:2016-11-21 09:36:21

标签: spring spring-mvc spring-boot

我们在spring-boot中创建了一个应用程序。我们有一个休息控制器,如下所示

 @RequestMapping(value = "getDataFromSpaceForTypeForSpaceId/{gridName}/{spaceName}/{dataType}/{spaceId}", method = GET, produces = "application/json")
    public DetailedJsonView getDataFromSpaceForTypeForSpaceId(@PathVariable String spaceId,
                                                              @PathVariable String dataType,
                                                              @PathVariable String gridName,
                                                              @PathVariable String spaceName) throws Exception {
        Object detailedObject = spaceAccessorService.getDetailedDataFromSpaceForTypeNameWithSpaceId(gridName, spaceName, dataType, spaceId);

        String detailedXml = ObjectMarshallarService.marshal(detailedObject);
        return new DetailedJsonView(detailedXml);
    }

这样的网址可以正常使用

http://localhost:8080/rest/query/getDataFromSpaceForTypeForSpaceId/COLO/gcmmprivateSpace/com.ambuj.ValuationSliceRun/InterestRates

这样的网址是最后一个变量spaceId

http://localhost:8080/rest/query/getDataFromSpaceForTypeForSpaceId/COLO/gcmmprivateSpace/com.ambuj.ValuationSliceRun/InterestRates#MUREX:RATES:EMEA:2015-01-01

现在我们在上面的url上看到的是spaceId是InterestRates而不是InterestRates#MUREX:RATES:EMEA:2015-01-01。

我不确定如何解决这个问题

0 个答案:

没有答案