Spring forms:input HTML5 required attribute

前端 未结 2 401
天涯浪人
天涯浪人 2021-01-25 09:51

I am using Spring forms and would like to use the HTML5 \'required\' attribute which Spring forms does not seem to support.



        
2条回答
  •  暖寄归人
    2021-01-25 09:58

    1. If you just submit the form with default commandName, your approach is ok.
    2. Better way to solve it: Write the form with spring-form and forget the required thing. Then find out what the real html spring-form generated for you. Write the html your own and add the required field.

提交回复
热议问题