top | item 42571034

(no title)

neeleshs | 1 year ago

Spring boot has form validations pretty much out of the box, via validation annotations.

discuss

order

ajmurmann|1 year ago

It does have validations but the integration of then in Rails goes much further. In Rails you associate the form with the model and the validation errors somatically show up on the form.

olavgg|1 year ago

The biggest difference here is that Spring Boot has the errors in a seperate object BindingResult. If you use Thymeleaf, this is smoothly integrated and you just write: <p th:if="${#fields.hasErrors('comment')}">Invalid Comment</p>

Grails Framework (Spring Framework more like Rails) integrates errors directly into the domain model, so if you have a domain class Person, it was extended with person.errors property.

nesarkvechnep|1 year ago

I'm amazed that some people think that coupling your forms to your database models is a good practice.