String page = null;
logger.info("User '" + request.getSession().getAttribute(AttributesManager.PARAM_NAME_LOGIN) + "'. Execute "
+ this.toString() + ". Process form data" + ". RemoteAddr: " + request.getRemoteAddr());
Form form = this.completeForm(request);
Date arrival = form.getArrival();
GregorianCalendar now = new GregorianCalendar();
if (arrival.before(now.getTime())) {
request.setAttribute(AttributesManager.ATTRIBUTE_ERROR_MESSAGE, MessageManager.WRONG_DATE_ERROR_MESSAGE);
page = ConfigurationManager.getInstance().getProperty(ConfigurationManager.ERROR_PAGE_PATH);
return page;
}
try {
AbstractDAOFactory daoFactory = Controller.getDAOFactory();
FormDAO formDAO = daoFactory.getFormDAO();
try {
formDAO.create(form);
} catch (IllegalArgumentException ex) {
logger.error(ex, ex);
}
Customer customer = (Customer) request.getSession().getAttribute(AttributesManager.ATTRIBUTE_CUSTOMER);
Order order = new Order();
order.setCustomerId(customer.getId());
order.setFormId(form.getId());
OrderDAO orderDAO = daoFactory.getOrderDAO();
try {
orderDAO.create(order);
} catch (IllegalArgumentException ex) {