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*/
}

Where I use the asterix my ide is coming back with an error ?

1

1 Answer 1

1

If you meant to use regex for matching then I guess what you want is

"/Foo/{id}/{friendlyUrl:.*}"

As per the doc the pattern must be {varName:regex}.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.