protected ActionForward process(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws JGossipException {
ForumDAO dao = ForumDAO.getInstance();
RankForm rForm = (RankForm) form;
try {
int count = Integer.parseInt(rForm.getCount());
int id = -1;
try {
id = Integer.parseInt(rForm.getId());
} catch (NumberFormatException e) {
id = -1;
}
List records = dao.getRankList();
Iterator it = records.iterator();
while (it.hasNext()) {
RankInfoDTO curr = (RankInfoDTO) it.next();
if (curr.getCount() == count && curr.getId() != id) {
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(
"errors.ERR23", rForm.getCount()));
saveErrors(request, errors);
return mapping.getInputForward();
}
}
saveRank(rForm);