I'm still having difficulties getting struts to select the appropriate option. My log goes something like this:
New RegisterForm created.
title is set to: Mr
setTitle will now call getTitle()
title is got as: Mr
firstname is set to: hello
RegisterForm.validate()
email has errors
password has errors
firstname is got as: hello
title is got as: null
A new Form is created, all the values are set using the setXXX methods.
However when it comes to displaying register.jsp again, the title field has been set to null, while all the other (text) fields remain as they are. This happens for all my <select> fields. It looks like the struts framework may be using reflection to set these fields to null. (Just my guess).
Can anybody explain this strange behaviour and put me on the right track?
My jsp fields are:
<html:text name="RegisterForm" property="firstName" maxlength="50" size="26"/>
and:
<%
houserent.domain.DropDownFactory factory = houserent.domain.DropDownFactory.getInstance();
request.setAttribute("personTitle", factory.getDropDown("Title"));
%>
<html:select property="title">
<html
ptions name="personTitle" property="categoriesList" labelName="personTitle" labelProperty="categoriesList"/>
</html:select>