When experimenting with Spring MVC, I noticed the values passed to controller arguments annotated with @PathVariable will have all the characters from the last '.' on stripped, unless the last character is a '/'.
For example, given the following code:
@RequestMapping("/host/${address})"
public String getHost(@PathVariable String address, Model model) {
model.addAttribute("host", hostRepository.getHost(address));
return "host";
}
If the URL is "/host/127.0.0.1", the value of address
will be "127.0.0". If the URL is "/host/127.0.0.1/", the value of address
will be "127.0.0.1".
Is there away to prevent this stripping?