Link to home
Create AccountLog in
Avatar of kkbenj
kkbenj

asked on

Java using properties data inside a form select box

I have a properties file that is loaded and accessible for my form.  I pull in several labels.  Now I need the pulldown box labels to be populated from this properties file.

this works correctly:
<form:select path="gender" id="gender">
        <form:option value="M" label="Male" />
        <form:option value="M" label="Female" />
</form:select>

but what I want is:
<form:select path="gender" id="gender">
        <form:option value="M" label="<fmt:message key="reg.malelabel"/>" />
        <form:option value="M" label="<fmt:message key="reg.femalelabel"/>" />
</form:select>

Can someone please explain what I am doing wrong?
Avatar of chaitu chaitu
chaitu chaitu
Flag of India image

try single quotes in key attribute..

<form:select path="gender" id="gender">
        <form:option value="M" label="<fmt:message key='reg.malelabel'/>" />
        <form:option value="M" label="<fmt:message key='reg.femalelabel'/>" />
</form:select>
Avatar of kkbenj
kkbenj

ASKER

Chaituu - that simply displays all the info <fmt...> in the pulldown box
ASKER CERTIFIED SOLUTION
Avatar of kkbenj
kkbenj

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of kkbenj

ASKER

I solved the question myself.