I'm developing a Liferay portlet using spring MVC. In the view part I have a dropdown field like that:
<form:select path="addressUsage">
<option>Home address</option>
<option>Postal address</option>
</form:select>
We know that in this case if the user select for example the first option so the value that the view will pass to the controller is "Home address" (in the attribute addressUsage of the corresponding class) But what I want is that the dropdown is displayed with "Home address" and "Postal address" options and what will pass to the controller is:
-> "HOME" in the case the user select "Home address" option.
-> "POSTAL" in the case the user select "Postal address" option
So I thought that I add a name attribute to the option tag. so the dropdown will be like that
<form:select path="addressUsage">
<option name="HOME">Home address</option>
<option name="POSTAL">Postal address</option>
</form:select>
So my question: is it possible to pass the name attribute of the corresponding selected option instead of the option text through the path attribute?