throws Exception {
if (log.isDebugEnabled()) {
log.debug("entering 'onSubmit' method...");
}
QuestionType questionType = (QuestionType) command;
boolean isNew = (questionType.getQuestionTypeId() == null);
Locale locale = request.getLocale();
if (request.getParameter("delete") != null) {
questionTypeManager.removeQuestionType(questionType.getQuestionTypeId().toString());
saveMessage(request, getText("questionType.deleted", locale));
} else {
questionTypeManager.saveQuestionType(questionType);
String key = (isNew) ? "questionType.added" : "questionType.updated";
saveMessage(request, getText(key, locale));
if (questionType.isEdited()) {
return new ModelAndView("redirect:updating.html?id=" + questionType.getQuestionTypeId() + "&fieldId=" + request.getParameter("fieldId"));
}
}
return new ModelAndView(getSuccessView());
}