1
@RequestMapping(value = "/Foo/{id}/{friendlyUrl:*}", method = RequestMethod.GET)
public ModelAndView getFoo(@PathVariable final Long id, @PathVariable final String friendlyUrl, final Principal principal) {
/* then match friendlyUrl,
* if it doesn't match use redirect
* view to send to correct place*/
}
我在哪裏使用asterix我的IDE是回來了一個錯誤?彈簧mvc匹配一個網址,並使用變量
你想用星號表達什麼?我只在這裏看到這種風格的模式http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping-uri-templates-regex,但那是一個不同的用例。 – burna