String msg = request.getParameter(Params.MESSAGE.getParamName());
if (msg == null || msg.isEmpty()) {
response.addFieldError(Params.MESSAGE.getParamName(),
FieldErrorTypes.FIELD_IS_EMPTY);
throw new RequestException(ReqErrorTypes.MISSING_ARGUMENT);
}
// String field is limited to 500 chars...
if (msg.length() > 499)
throw new RequestException(ReqErrorTypes.CONTENT_EXCEED_MAX_LENGTH);
int priority = 0;
try {
priority = Integer.parseInt(request.getParameter(Params.PRIORITY
.getParamName()));
} catch (NumberFormatException e) {
log.warning(e.getMessage());
response.addFieldError(Params.PRIORITY.getParamName(),
FieldErrorTypes.VALUE_NOT_VALID);
throw new RequestException(ReqErrorTypes.MISSING_ARGUMENT);
}
PersonalNotesAppsData item = new PersonalNotesAppsData(