Get messages from properties file in select Spring label

1

I'm internationalizing a web application where I have a select with two options

<td><form:label path="rol">Rol</form:label></td>
                <td><form:select path="rol">
                        <form:option value="USER" label="Usuario"/>
                        <form:option value="ADMIN" label="Administrador"/>
                    </form:select>
</td>

And I have two properties files (messages.properties and messages_en.properties) to paint on the screen that information I do it this way

<spring:message code="label.phone" />

But I do not know how to collect the values of that file to paint it in the labels of a select. The fields are the following:

label.rolUsu=User
label.rolAdmi=Administrator

Any help?

    
asked by Eduardo 23.03.2018 в 09:58
source

1 answer

1

Instead of putting

<form:option value="ADMIN" label="Administrador"/>

you can write it like this:

<form:option value="ADMIN"><spring:message code="label.rolAdmi"/></form:option>
    
answered by 23.03.2018 / 10:49
source