spring mvc - Mismatch in @PathVariable resolving -
let's suppose have method signature:
@requestmapping(value = "/verifyusers/{site}/{users}", method = requestmethod.get) @responsebody public list<string> verifyuser( @pathvariable("site") string site, @pathvariable("users") string[] users) { ... }
receving request /verifyusers/aoud/farmaci.rain,farmaci.postacuti
we get: site="aoud" , users = [farmaci.rain, farmaci] lose second part of second string after dot ("postacuti")
i think it's fault of org.springframework.util.antpathmatcher ...
use below code 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:.+}
Comments
Post a Comment