Using spring: post tag inside a form: input tag in Spring MVC

I want to internationalize attribute content in my Spring MVC application, snippet code from my JSP file:

<form:input type="text" path="someAttribute" title="something"/>

      

And it works great, but when I want to internationalize like this:

<form:input type="text" path="someAttribute" 
title="<spring:message code="label.something"/>"/>

      

seems to be wrong as it is throwing org.apache.jasper.JasperException

Exception. My question is: How can I internationalize the string "Something" inside the title attribute in the tag form:input

?

+3


source to share


1 answer


You can use JSTL tags



<c:set var="title"><spring:message code="label.something"/></c:set>
<form:input type="text" path="someAttribute" title="${title}"/>

      

+3


source







All Articles