} else if (findPersonForm.get("viewPhoto") != null) { viewPhoto = getCheckBoxValue((String) findPersonForm.get("viewPhoto")); } findPersonForm.set("viewPhoto",viewPhoto.toString()); request.setAttribute("viewPhoto", viewPhoto);
    public ActionForward preparePerson(ActionMapping mapping, ActionForm actionForm,            HttpServletRequest request, HttpServletResponse response) throws Exception {        DynaActionForm findPersonForm = (DynaActionForm) actionForm;        String roleType = null;        String degreeType = null;        if (request.getParameter("roleType") != null && request.getParameter("roleType").length() > 0) {            roleType = (String) request.getParameter("roleType");        } else if (findPersonForm.get("roleType") != null) {            roleType = (String) findPersonForm.get("roleType");        }        if (request.getParameter("degreeType") != null                && request.getParameter("degreeType").length() > 0) {            degreeType = (String) request.getParameter("degreeType");        } else if (findPersonForm.get("degreeType") != null) {            degreeType = (String) findPersonForm.get("degreeType");        }        if (roleType != null && roleType.length() != 0) {            if (roleType.equals(RoleType.EMPLOYEE.getName())                    || roleType.equals(RoleType.TEACHER.getName())) {                if (roleType.equals(RoleType.TEACHER.getName())) {                    List departments = (List) ServiceUtils.executeService(null, "ReadAllDepartments",                            null);                    request.setAttribute("departments", departments);                }                // request.removeAttribute("degreeType");            }            if (roleType.equals(RoleType.STUDENT.getName())) {                if (degreeType.length() != 0) {                    Object[] args = { degreeType };                    List nonMasterDegree = (List) ServiceUtils.executeService(null,                            "ReadAllDegreesByType", args);                    request.setAttribute("nonMasterDegree", nonMasterDegree);                    request.setAttribute("degreeType", true);                }                findPersonForm.set("degreeType", degreeType);                request.setAttribute("degreeType", degreeType);            }            findPersonForm.set("roleType", roleType);            request.setAttribute("roleType", roleType);        }        String name = null;        if (request.getParameter("name") != null && request.getParameter("name").length() > 0) {            name = request.getParameter("name");        } else if (findPersonForm.get("name") != null) {            name = (String) findPersonForm.get("name");        }        if (name != null && name.length() > 0) {            findPersonForm.set("name", name);        }        return mapping.findForward("findPerson");    }