0

We have a legacy product with simple JSP and Servlet technologies and we got a new requirement to implement a REST API based on existing business logic layer. Therefore we thought of integrating Spring MVC and use the Spring's rest support. After reading the documentation i decided configure the MVC through the XML as below

<mvc:annotation-driven/>

however this automatically registers couple of additional beans including Support for validating @Controller inputs with @Valid(JSR-303). We do not use hibernate in our application and there is no real requirement to use this feature in our application for the moment. Is there any way of disabling this validation support?

I found below question, but i prefer more elegant solution with a simple configuration.

How to force disable JSR-303 support in Spring 3?

Slava Semushin
  • 14,904
  • 7
  • 53
  • 69
keth
  • 793
  • 2
  • 11
  • 36
  • Could I ask why you need to disable it? If you don't use it, it shouldn't affect the application. Did you try to exclude the dependencies which provide JSR-303 support (`hibernate-validator`, in most of the cases)? – Slava Semushin Jan 18 '18 at 16:09
  • @SlavaSemushin, We do not use hibernate or JPA in our project. When i try to run the project with , it complains that we do not have a validator library in classpath and it insists to include a library such as hibernate-validator – keth Jan 19 '18 at 08:28
  • Ok, I see. But `hibernate-validator` is not related to Hibernate/JPA at all. It's bean validation provider. Yes, it has hibernate in its name, but it's only a name. – Slava Semushin Jan 19 '18 at 10:54

0 Answers0