The method below fails with "PatternSyntaxException: Unclosed counted closure near index ... "
@RequestMapping(value ="/{id:[0-9|a-z]{15}}")
public View view(@PathVariable final String id) {
...
}
Looks like the pattern matcher is trimming too much off the the string and losing the last }.
Does anyone know a work around to this bug? I'm having to drop the qualifier to "/{id:[0-9|a-z]+}" - which frankly suck!
Here's a solution. It's butt-ugly, but it's equivalent to what you'd like to have:
@RequestMapping(value = "/{id:[0-9a-z][0-9a-z][0-9a-z][0-9a-z]" +
"[0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z]" +
"[0-9a-z][0-9a-z][0-9a-z][0-9a-z]}") // 15 repetitions of [0-9a-z]
If that's the only way to get what you need, you might as well use this monster.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With