Bobo
Bobo

Reputation: 9163

Use spring form tags or not?

I am working on a new web project based on Spring MVC 3. Now trying to decide to use spring form tags or not. Personally I don't like to use any tags other than HTML and JSP. It takes time to learn them and it is so hard to understand how they are rendered and the error msgs when they occur. So are there any outstanding advantages to use them? Thank you!

Upvotes: 5

Views: 1869

Answers (3)

Javi
Javi

Reputation: 19769

Another benefit of spring tags is that when you make a mistake and you write the name of a property which doesn't exist in the object to populate it gives you an error, so you can easily find-out that you have to correct the name of the property in the path attribute of the tag.

Upvotes: 3

Simon Dyson
Simon Dyson

Reputation: 645

The benefit of using the spring form tags is that you will get consistent data binding and error handling across your entire website. I would recommend wrapping the spring form tags in your own tags - this will allow you to easily swap in your own implementations at a later date if you find the spring tags lacking functionality you need.

Upvotes: 2

skaffman
skaffman

Reputation: 403471

The Spring MVC form tags are very basic indeed, but they're better than nothing. If you're trying to render HTML forms, with submissions, error messages, and resubmissions, they take a lot of the annoyance away (especially for <select> fields, which are a huge pain to handle otherwise).

For anything more complex, they're pretty useless, but for forms, I see no reason to not use them.

Upvotes: 4

Related Questions