String name = (String)insertPublicationForm.get("authorName"); String org = (String)insertPublicationForm.get("authorOrganization");
ActionErrors errors = new ActionErrors(); String name = (String) insertPublicationForm.get("authorName"); if(name == null || name.equals("")){ errors.add("error1", new ActionError("message.publication.missingAuthor")); } String org = (String) insertPublicationForm.get("authorOrganization"); if(org == null || org.equals("")){ errors.add("error2", new ActionError("message.publication.missingOrganization")); }  if (!errors.isEmpty()) { saveErrors(request, errors); return mapping.findForward("searchAuthors"); }
    public ActionForward externalAuthor(ActionMapping mapping, ActionForm form, HttpServletRequest request,            HttpServletResponse response) throws FenixFilterException, FenixServiceException {    	DynaActionForm insertPublicationForm = (DynaActionForm) form;    	    	String name = (String)insertPublicationForm.get("authorName");    	String org = (String)insertPublicationForm.get("authorOrganization");    	    	String nameAndOrg = name + "'.'" + org;    	    	Integer[] authorsId = (Integer[]) insertPublicationForm.get("authorsId");        String[] authorsName = (String[]) insertPublicationForm.get("authorsName");    	        Integer[] newAuthorsId = new Integer[authorsId.length + 1];        String[] newAuthorsName = new String[authorsName.length + 1];        for (int i = 0; i < authorsId.length; i++) {            newAuthorsId[i] = authorsId[i];            newAuthorsName[i] = authorsName[i];        }        newAuthorsId[newAuthorsId.length - 1] = new Integer(-1);        newAuthorsName[newAuthorsName.length - 1] = nameAndOrg;        insertPublicationForm.set("authorsId", newAuthorsId);        insertPublicationForm.set("authorsName", newAuthorsName);                lightPrepare(mapping, form, request, response);        return mapping.findForward("edit");    }