How to specify HTML5 attributes using Struts 2.x?

I use Struts2 extensively in my application. Now I want to add HTML5 attributes such as autocorrect and type="email" . I do not see any HTML5 plugin. Is there a standard way for the <s:textfield..> , for example?

+6
source share
1 answer

You can add HTML5 attributes directly to the textfield tag. I did it successfully with pattern , min and max , they render correctly in HTML.

 <s:textfield type="number" name="..." value="%{...}" pattern="[0-9]+" min="40" max="700" /> 
+9
source

Source: https://habr.com/ru/post/918299/


All Articles