protected void saveForm(AbstractEditorForm form, ActionMapping actionMapping, HttpServletRequest request)
throws Exception {
String oid = form.getOid();
Class objectClass = getObjectType(actionMapping, request);
ObjectRepository objectRepository = getRepository(objectClass);
DomainObject object;
String action = form.getAction();
if (action.equals(UPDATE_ACTION)) {
object = (DomainObject)objectRepository.load(Integer.parseInt(oid));
populateObject(request, object, form);
objectRepository.update(object);
} else if (action.equals(CREATE_ACTION)) {
object = createObject(objectClass, request, form, objectRepository);
} else {
throw new ServletException("Unknown editor action: " + action);
}