FunctionalityContext context = new TestFilterContext(request, bean, functionality); try { results.add(new TestFilterResultBean(functionality, functionality.isAvailable(context, person))); } catch (GroupDynamicExpressionException e) { results.add(new TestFilterResultBean(functionality, false));
Functionality targetFunctionality = null; if (! functionality.isPrincipal()) { for (Functionality testedFunctionality : RootDomainObject.getInstance().getFunctionalities()) { if (! testedFunctionality.isPrincipal()) { continue; }  if (testedFunctionality.getMatchPath() == null) { continue; }  if (testedFunctionality.getMatchPath().equals(functionality.getMatchPath())) { targetFunctionality = testedFunctionality; break; } } } else { targetFunctionality = functionality; }  if (targetFunctionality != null) { FunctionalityContext context = new TestFilterContext(request, bean, targetFunctionality); try { results.add(new TestFilterResultBean(functionality, functionality.isAvailable(context), bean.getParametersMap())); } catch (GroupDynamicExpressionException e) { results.add(new TestFilterResultBean(functionality, false, bean.getParametersMap())); }
    public ActionForward results(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception {        TestFilterBean bean = getBean();                if (bean == null) {            return index(mapping, actionForm, request, response);        }                Person person = bean.getTargetPerson();        if (person == null) {            addBeanMessage(request, bean);            return selectBean(mapping.findForward("index"), request, bean);        }                List<TestFilterResultBean> results = new ArrayList<TestFilterResultBean>();        for (Functionality functionality : RootDomainObject.getInstance().getFunctionalities()) {            if (functionality.getMatchPath() == null) {                continue;            }                        FunctionalityContext context = new TestFilterContext(request, bean, functionality);            try {                results.add(new TestFilterResultBean(functionality, functionality.isAvailable(context, person)));            } catch (GroupDynamicExpressionException e) {                results.add(new TestFilterResultBean(functionality, false));            }        }                request.setAttribute("results", results);        return selectBean(mapping.findForward("results"), request, bean);    }