handler.preStorePersistents(wrappedRequest, formular, formular.getPersistents(), new Boolean(modified));
if (request.getParameter(NO_FORM_STORE) == null && validate
&& ! NumberTools.toBool(request.getParameter(SYSTEM_EDIT), false))
{
ValidationResult result = null;
try
{
result = FormTools.validateInput(wrappedRequest, wrappedResponse, formular, formular
.getPersistents());
handler.validatePersistents(persistentConfig, wrappedRequest, wrappedResponse, formular, formular
.getPersistents(), NumberTools.toInt(id, - 1) == - 1, result);
}
catch (Exception x)
{
System.out.println("[Save] Error while validating input: " + x);
x.printStackTrace();
}
if (result.hasErrors())
{
formular.setPage(Math.max(formular.getPageWithField(result.getFirstErrorField(formular).replaceAll(
"_", ".")), 0));
}
result.createResponseElements(wrappedResponse, formular);
if (result.hasErrors())
{
if (! NumberTools.toBool(request.getParameter(SYSTEM_EDIT), false))
{
BeanRequest newRequest = new BeanRequest();
newRequest.setBean(cmdEdit.getModel());
newRequest.setLocale(request.getLocale());
newRequest.setUserEnvironment(request.getUserEnvironment());
newRequest.setParameter(keyName, id);
newRequest.setParameter("error", result.getFirstErrorField(formular));
redirect(cmdEdit.getModel(), newRequest, response);
return;
}
else
{