![](/img/trans.png)
[英]Handling a form with Spring MVC without using the Spring <form:form> tag?
[英]Using spring:message tag inside of form:input tag in Spring MVC
我想在我的Spring MVC應用程序中對屬性的內容進行國際化,這是我的JSP文件中的代碼段代碼:
<form:input type="text" path="someAttribute" title="something"/>
它工作正常,但當我想這樣國際化時:
<form:input type="text" path="someAttribute"
title="<spring:message code="label.something"/>"/>
它似乎錯了,因為它拋出了一個org.apache.jasper.JasperException
異常。 我的問題是:我如何將我的form:input
title屬性中的“Something”字符串國際化form:input
標簽?
您可以使用JSTL標記
<c:set var="title"><spring:message code="label.something"/></c:set>
<form:input type="text" path="someAttribute" title="${title}"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.