JSP
<select name="requirements" style="width:150px;" id="requirements1">
<option selected="selected" value="o Special Assistance">No Special Assistance</option>
<option value="Assistance climbing steps">Assistance climbing steps</option>
<option value="Assistance within the plane">Assistance within the plane</option>
<option value="Blind passenger">Blind passenger</option>
<option value="Hearing impaired">Hearing impaired</option>
<option value="Wheelchair within terminal">Wheelchair within terminal</option>
</select>
<select name="requirements" style="width:150px;" id="requirements2">
<option selected="selected" value="o Special Assistance">No Special Assistance</option>
<option value="Assistance climbing steps">Assistance climbing steps</option>
<option value="Assistance within the plane">Assistance within the plane</option>
<option value="Blind passenger">Blind passenger</option>
<option value="Hearing impaired">Hearing impaired</option>
<option value="Wheelchair within terminal">Wheelchair within terminal</option>
</select><input type="text" name="specialrequest" id="specialrequest1" />
</form>
クラス
public class PassengerDetailDTO {
private String[] requirements;
private String specialrequest;
}
そしてコントローラーで
@RequestMapping(value = "/manualbooking.htm", method = RequestMethod.POST)
public String doManualBooking(HttpServletRequest httpServletRequest,
PassengerDetailDTO passengerDetailDTO, ModelMap map) {
LOGGER.info("Manual Booking Request");
LOGGER.info(passengerDetailDTO.toString());
return "manualbooking";
}
複数のドロップダウン ボックスがある場合、送信後のフォーム要件は常に null です。それを解決する方法?