如何使用在的属性内?
我的 JSP 代码如下:
<div class="formRow">
<form:input id="email_email" name="email_email" title="XXXXX"/>" path="email" cssClass="input required email" />
<form:errors path="email" cssClass="error" />
</div>
我想使用一些工具提示文本设置 title
属性,支持 i18n。我该怎么做?
我想做这样的事情:
<div class="formRow">
<form:input id="email_email" name="email_email" title="<spring:message code="tooltip.text" />"/>" path="email" cssClass="input required email" />
<form:errors path="email" cssClass="error" />
</div>
I have JSP code like:
<div class="formRow">
<form:input id="email_email" name="email_email" title="XXXXX"/>" path="email" cssClass="input required email" />
<form:errors path="email" cssClass="error" />
</div>
I want to set the title
attribute with some tooltip text, supporting i18n. How would I do this?
I am looking to do something like this:
<div class="formRow">
<form:input id="email_email" name="email_email" title="<spring:message code="tooltip.text" />"/>" path="email" cssClass="input required email" />
<form:errors path="email" cssClass="error" />
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您不能在属性内使用标签:
但你可以使用上面的。效果很好。
You can't use a tag inside an attribute:
But you can use the above. It works fine.
简单地说,您不能在标签内使用标签。你可以这样做,
PS最好使用
${i18nTooltip}
,而不是i18nTooltip
,以避免混淆。You can't use a tag inside a tag, simply. You can do something like this,
P.S. Better use
${i18nTooltip}
, instead of,i18nTooltip
, to avoid confusion.我认为这是最干净的方法:
查找更改后的代码,我已将标题属性的双引号删除为单引号,其效果令人惊叹。
I think this is the most cleaner way to do it :
Look for the changed code being, I have removed double qoutes of title attribut to single qoutes and its works wonders.