如何使用Struts 2.x指定HTML5属性? [英] How do I specify HTML5 attributes with Struts 2.x?

查看:107
本文介绍了如何使用Struts 2.x指定HTML5属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中广泛使用Struts2。现在我想添加HTML5属性,如自动更正 type =email。我没有看到任何HTML5插件。例如,< s:textfield ..> 标记是否有标准方法?

I make extensive use of Struts2 in my application. Now I want to add HTML5 attributes like autocorrect and type="email". I don't see any HTML5 plugin. Is there a standard way to the <s:textfield..> tag for example?

推荐答案

您可以将 HTML5 属性直接添加到 textfield 标记中。我已经成功完成了模式 min max ,它们在HTML中正确呈现。

You can add HTML5 attributes directly into the textfield tag. I've done it successfully with pattern, min and max, they are correctly rendered in the HTML.

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

这篇关于如何使用Struts 2.x指定HTML5属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆