HtmlValidator htmlValidator = new HtmlValidator(); htmlValidator.validateHTMLString(information); String errors = htmlValidator.getErrors();  if((errors != null) && (!errors.equals(""))){ ActionErrors actionErrors = new ActionErrors(); request.setAttribute("errors", errors); actionErrors.add("htmlErrors", new ActionError("html.validate.error")); saveErrors(request, actionErrors); return mapping.getInputForward(); }
    public ActionForward insertItem(ActionMapping mapping, ActionForm form, HttpServletRequest request,            HttpServletResponse response) throws FenixActionException, FenixFilterException {        HttpSession session = request.getSession(false);        Integer sectionCode = getSectionCode(request);        Integer objectCode = getObjectCode(request);        DynaActionForm dynaForm = (DynaValidatorForm) form;        Integer order = new Integer((String) dynaForm.get("itemOrder"));        String itemName = (String) dynaForm.get("name");        String information = (String) dynaForm.get("information");                HtmlValidator htmlValidator = new HtmlValidator();             htmlValidator.validateHTMLString(information);        String errors = htmlValidator.getErrors();                     if((errors != null) && (!errors.equals(""))){            ActionErrors actionErrors = new ActionErrors();            request.setAttribute("errors", errors);            actionErrors.add("htmlErrors", new ActionError("html.validate.error"));            saveErrors(request, actionErrors);            return mapping.getInputForward();        }                String urgentString = (String) dynaForm.get("urgent");        InfoItem newInfoItem = new InfoItem();        newInfoItem.setItemOrder(order);        newInfoItem.setName(itemName);        newInfoItem.setInformation(information);        newInfoItem.setUrgent(new Boolean(urgentString));        IUserView userView = (IUserView) session.getAttribute(SessionConstants.U_VIEW);        Object args[] = { objectCode, sectionCode, newInfoItem };        try {            ServiceManagerServiceFactory.executeService(userView, "InsertItem", args);        } catch (ExistingServiceException e) {            throw new ExistingActionException("Um item com esse nome", e);        } catch (FenixServiceException fenixServiceException) {            throw new FenixActionException(fenixServiceException.getMessage());        }        return viewSection(mapping, form, request, response);    }