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?
kkbenjAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chaitu chaituCommented:
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>
kkbenjAuthor Commented:
Chaituu - that simply displays all the info <fmt...> in the pulldown box
kkbenjAuthor Commented:
I figured out the solution.

Step 1: set a variable = fmt:message
<c:set var="genderMale"><fmt:message key="reg.malelabel"/></c:set>

Step 2: call the variable within the label
<form:option value="M" label="${genderMale}" />

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kkbenjAuthor Commented:
I solved the question myself.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.