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?
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?
ASKER
Chaituu - that simply displays all the info <fmt...> in the pulldown box
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I solved the question myself.
<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>