VigilantGroupBean bean = (VigilantGroupBean) RenderUtils.getViewState("selectVigilant") .getMetaObject().getObject(); VigilantGroup group = bean.getSelectedVigilantGroup(); List<Vigilant> vigilants = new ArrayList<Vigilant>(group.getVigilants());
VigilantGroupBean bean = (VigilantGroupBean) RenderUtils.getViewState( "selectVigilant").getMetaObject().getObject(); VigilantGroup group = bean.getSelectedVigilantGroup(); if (group != null) { List<Vigilant> vigilants = new ArrayList<Vigilant>(group .getVigilants());
    public ActionForward vigilantSelectedInIncompatibilityScreen(ActionMapping mapping, ActionForm form,            HttpServletRequest request, HttpServletResponse response) throws Exception {        VigilantGroupBean bean = (VigilantGroupBean) RenderUtils.getViewState("selectVigilant")                .getMetaObject().getObject();        VigilantGroup group = bean.getSelectedVigilantGroup();        List<Vigilant> vigilants = new ArrayList<Vigilant>(group.getVigilants());        Vigilant selectedVigilant = bean.getSelectedVigilant();        if (selectedVigilant != null) {            vigilants.remove(selectedVigilant);            if (selectedVigilant.hasIncompatiblePerson()) {                vigilants.remove(selectedVigilant.getIncompatibleVigilant());            }        }        bean.setVigilants(vigilants);        request.setAttribute("bean", bean);        RenderUtils.invalidateViewState("selectVigilant");        return mapping.findForward("addIncompatiblePersonToVigilant");    }