您好我有如下一個jsp:幫助創建一個動作類(JAVA)
<form action="testPage.do" method="post" name='testForm' id="testForm">
<h2><bean:message bundle="test" key="label.header1"/></h2>
<p><bean:message bundle="test" key="label.dropdown1/> </label>
<select>
<option selected="selected">Soccer</option>
<option>Football</option>
<option>Baseball</option>
<option>Hockey</option>
</select>
</p>
<p>
<label><bean:message bundle="test" key="label.firstName"/> </label>
<input type="text"" name="firstname">
</p>
<p>
<label><bean:message bundle="test" key="label.lastName"/> </label>
<input type="text"" name="lastname">
</p>
</form>
我想創建一個Action類將填充我的下拉菜單中,我也得到那就是價值鍵入到名字和姓氏文本框中。 對於動作類我:
public class SportAction extends BaseAction {
public ProcessResult executeFirstTimeInLogic(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response,
ProcessResult processResult) throws Exception {
log.info("executeFirstTimeInLogic");
processResult.setForward(mapping.findForward("next"));
return processResult;
}
public ProcessResult executeSubmitLogic(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response,
ProcessResult processResult) throws Exception {
log.info("executeSubmitLogic");
return processResult;
}
}
如何我將創建方法來獲取輸入到文本框,並填充下拉菜單從動作類的方法值是多少?