0

I've a very simple Spring MVC application, for example:

@Controller
@RequestMapping("/rest")
public class MyController {
    @RequestMapping(value = "/endpointA"}
    public @ResponseBody ResponseObject endpointA() {
        return something;
    }
}

The endpoint method should be mapped to the URL: "/rest/endpointA", but it is invoked also for "/%20rest/endpointA", "/rest /endpointA" and any form of leading and/or trailing whitespaces.

Why is it, and is there a way to enforce an exact match of the URL to "/rest/endpointA", in terms of "/%20rest/endpointA" would result in a 404 Not Found response by Tomcat.

Thanks

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Stefgo83
  • 51
  • 3

0 Answers0