如何使用< spring:message>在< form:input&gt ;?的属性中 [英] How to use <spring:message> inside an attribute of <form:input>?

查看:93
本文介绍了如何使用< spring:message>在< form:input&gt ;?的属性中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下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>

我想用一些工具提示文本设置标题属性,支持i18n。我该怎么做?

I want to set the title attribute with some tooltip text, supporting i18n. How would I do 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>


推荐答案

<spring:message code="tooltip.text" var="variable1"/>
<form:input id="email_email" name="email_email" title="${variable1}" path="email" 
                      cssClass="input required email" />

您不能在属性中使用标签:
但您可以使用上述。它工作正常。

You can't use a tag inside an attribute: But you can use the above. It works fine.

这篇关于如何使用&lt; spring:message&gt;在&lt; form:input&gt ;?的属性中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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