0

Let's suppose to have this method signature:

@RequestMapping(value = "/verifyusers/{site}/{users}", method = RequestMethod.GET)
@ResponseBody   
public List<String> verifyUser(
    @PathVariable("site") String site, @PathVariable("users") String[] users) {
    ...
}

Receving a request like GET /verifyusers/AOUD/farmaci.rain,farmaci.postacuti

we get: site="AOUD" and users = [farmaci.rain, farmaci] that is we lose the second part of second String after dot ("postacuti")

I think it's the fault of org.springframework.util.AntPathMatcher ...

Balicanta
  • 109
  • 6
  • 1
    possible duplicate of [Spring MVC @PathVariable with dot (.) is getting truncated](http://stackoverflow.com/questions/16332092/spring-mvc-pathvariable-with-dot-is-getting-truncated) – Balicanta Jul 14 '15 at 10:43

1 Answers1

0

Use below code to prevent truncation of parameter after ' . '

@RequestMapping(value = "/verifyusers/{site}/{users:.+}", method = RequestMethod.GET)
@ResponseBody   
public List<String> verifyUser(
    @PathVariable("site") String site, @PathVariable("users") String[] users) {
    ...
}

Note: {users:.+}

Jebil
  • 1,144
  • 13
  • 25