Hi,
would like to populate a drop down list on a jsp page
i have my page that looks like
<form:form method="POST" action="addRss.htm" commandName="addNewRss" cssClass="addUserForm">
<div class="floatL">
<div class="padding5">
<div class="fieldContainer">
<strong>Title:</strong>
</div>
<form:errors path="title" cssClass="error"/>
<form:input path="title" cssClass="textArea" />
</div>
<div class="padding5">
<div class="fieldContainer">
<strong>Description:</strong>
</div>
<form:errors path="description" cssClass="error"/>
<form:input path="description" cssClass="textArea" />
</div>
<div class="padding5">
<div class="fieldContainer">
<strong>Language:</strong>
</div>
<form:errors path="language" cssClass="error"/>
<form:select path="language" cssClass="textArea" />
</div>
</div>
<div class="floatR">
<div class="padding5">
<div class="fieldContainer">
<strong>Link:</strong>
</div>
<form:errors path="link" cssClass="error"/>
<form:input path="link" cssClass="textArea" />
</div>
<div class="padding5">
<div class="fieldContainer">
<strong>Url:</strong>
</div>
<form:errors path="url" cssClass="error"/>
<form:input path="url" cssClass="textArea" />
</div>
<div class="padding5">
<div class="fieldContainer">
<strong>Url</strong>
</div>
<form:errors path="url" cssClass="error"/>
<form:input path="url" cssClass="textArea" />
</div>
</div>
<input type="submit" class="floatR" value="Add New Rss">
</form:form>
and my controller
public class AddRssController extends BaseController {
private static final String[] LANGUAGES = { "AL", "AK", "AZ", "AR", "CA",
"CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA",
"KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT",
"NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR",
"PA", "RI", "SC", "SD", "TN", "TX", "UT", "VA", "VT", "WA", "WV",
"WI", "WY" };
public AddRssController() {
setCommandClass(RSS.class);
setCommandName("addNewRss");
}
@Override
protected Object formBackingObject(HttpServletRequest request)
throws Exception {
RSS rantForm = (RSS) super.formBackingObject(request);
// rantForm.setVehicle(new Vehicle());
return rantForm;
}
@Override
protected Map referenceData(HttpServletRequest request) throws Exception {
Map referenceData = new HashMap();
referenceData.put("language", LANGUAGES);
return referenceData;
}
@Override
protected ModelAndView onSubmit(Object command, BindException bindException)
throws Exception {
RSS rss = (RSS) command;
rssServiceImplementation.add(rss);
return new ModelAndView(getSuccessView());
}
}
and my BaseController
public class BaseController extends SimpleFormController implements Controller {
public UserServiceImplementation userServiceImplementation;
public UserServiceImplementation getUserServiceImplementation() {
return userServiceImplementation;
}
public void setUserServiceImplementation(UserServiceImplementation userServiceImplementation) {
this.userServiceImplementation = userServiceImplementation;
}
public RssServiceImplementation rssServiceImplementation;
public RssServiceImplementation getRssServiceImplementation() {
return rssServiceImplementation;
}
public void setRssServiceImplementation(RssServiceImplementation rssServiceImplementation) {
this.rssServiceImplementation = rssServiceImplementation;
}
}
But it doesn t work
Any suggestion?