How to validate Spring MVC @PathVariable values?

前端 未结 6 1832
难免孤独
难免孤独 2020-12-09 03:28

For a simple RESTful JSON api implemented in Spring MVC, can I use Bean Validation (JSR-303) to validate the path variables passed into the handler method?

For examp

6条回答
  •  隐瞒了意图╮
    2020-12-09 04:28

    Path variable may not be linked with any bean in your system. What do you want to annotate with JSR-303 annotations? To validate path variable you should use this approach Problem validating @PathVariable url on spring 3 mvc

提交回复
热议问题