此代码获取完整路径:
@RequestMapping(value = "/modules/{modulebaseName}/**", method = RequestMethod.GET)@ResponseBodypublic String moduleStrings(@PathVariable String modulebaseName, HttpServletRequest request) { final String path = request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE).toString(); final String bestMatchingPattern = request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE).toString(); String arguments = new AntPathMatcher().extractPathWithinPattern(bestMatchingPattern, path); String moduleName; if (null != arguments && !arguments.isEmpty()) { moduleName = modulebaseName + '/' + arguments; } else { moduleName = modulebaseName; } return "module name is: " + moduleName;}


