I am wondering is it good practice to write all forms in spring tags or can I mix spring form tags with html form tags?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Use Spring forms when you need functionality provided by them:
- binding to objects
- configurable field formatting
- redisplay of values on errors
- binding of error messages
For simple forms (such as a simple search box on each page) you usually don't need these features - therefore you can use simple HTML forms for them.
回答2:
Springs form:form
tag is supposed to be used with whenever you have a formbacking
object you wish to bind to the form (a model
object delivered to your view).
There are no additional benefits of using the tag in a regular form with no backing object.