79415139

Date: 2025-02-05 14:50:45
Score: 3
Natty:
Report link

In my case, Spring was intercepting the request before it reached my controller method, which caused the validation to not work as expected. By default, the @RequestParam annotation has the required attribute set to true, meaning Spring would reject the request if the parameter was missing. To resolve this, I set required = false in the @RequestParam annotation. This allowed the request to reach my controller method, where the validation could be properly applied.

Reasons:
  • No code block (0.5):
  • User mentioned (1): @RequestParam
  • User mentioned (0): @RequestParam
  • Single line (0.5):
  • Low reputation (1):
Posted by: Lucas Kissmann