if (carIndex != null && carIndex >= 0) {
List<RESCarType> cars = searchModel.getCars();
if (carIndex < cars.size()) {
CustomerDetailsType customerDetails = searchModel.getCustomer();
RESCarType selectedCar = cars.get(carIndex);
SearchRequestParameters requestParams = getSessionAttribute(
session, SearchRequestParameters.class);
RESStatusType resStatus = null;
ConfirmationType confirm = null;
try {
resStatus = reserveModel.reserveCar(customerDetails,
selectedCar, requestParams.getPickupDate(),
requestParams.getReturnDate());
confirm = reserveModel.getConfirmation(resStatus,
customerDetails, selectedCar,
requestParams.getPickupDate(),
requestParams.getReturnDate());
} catch (Exception e) {
model.addAttribute("excptMessage", e);
return "error";
}