Package javax.faces.el

Examples of javax.faces.el.VariableResolver.resolveVariable()


            // Get the newly added role.
            Role addedRole = roleMgr.getRole(roleToAddPath);
            // Resolve the tree table.
            FacesContext facesContext = FacesContext.getCurrentInstance();
            VariableResolver vr = facesContext.getApplication().getVariableResolver();
            RoleTreeTable roleTree = (RoleTreeTable) vr.resolveVariable(facesContext, RoleTreeTable.ROLE_TREE_TABLE);
            // Get the listeners registered.
            Collection listeners = roleTree.getTreeModel().getTreeModelListeners();
            // TODO We could be more sophisticated and not rebuild the old tree.  For now this will do.
            roleTree.setTreeModel(SecurityApplicationUtils.buildRoleTreeModel());
            // Get the new tree model.
View Full Code Here


   * Returns the requested object configured in the faces-config or from library.
   */
  public static Object resolveVariable(FacesContext context, String variable) {
    Application application = context.getApplication();
    VariableResolver variableResolver = application.getVariableResolver();
    return variableResolver.resolveVariable(context, variable);
  }

  /**
   * Returns the ClientProperties object configured in the faces-config.
   */
 
View Full Code Here

        // }

        // Resolve the variable name
        VariableResolver vr = application().getVariableResolver();
        String name = (String) names.get(0);
        Object base = vr.resolveVariable(context, name);
        // System.out.println("  base=" + base);
        if (names.size() < 2) {
            return (base);
        }
View Full Code Here

        // }

        // Resolve the variable name
        VariableResolver vr = application().getVariableResolver();
        String name = (String) names.get(0);
        Object base = vr.resolveVariable(context, name);
        // System.out.println("  base=" + base);
        if (names.size() < 2) {
            if ("applicationScope".equals(name) ||
                "requestScope".equals(name) ||
                "sessionScope".equals(name)) {
View Full Code Here

//      final ELContext elContext = context.getELContext();
//      return elContext.getELResolver().getValue(elContext, null, variable);
//    } else {
      final Application application = context.getApplication();
      final VariableResolver variableResolver = application.getVariableResolver();
      return variableResolver.resolveVariable(context, variable);
//    }
  }

  /**
   * Returns the ClientProperties object configured in the faces-config.
View Full Code Here

  }

  public static Object resolveVariable(FacesContext context, String variable) {
    Application application = context.getApplication();
    VariableResolver variableResolver = application.getVariableResolver();
    return variableResolver.resolveVariable(context, variable);
  }

  /**
   * Clears the value of the variable.
   * Useful for cleaning up e.g. a session or application variable
View Full Code Here

  }

  public String navigateAction() {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    VariableResolver resolver = facesContext.getApplication().getVariableResolver();
    Navigation navigation = (Navigation) resolver.resolveVariable(facesContext, "navigation");

    // in case of both the select control is not processed during lifecycle
    // we need to get the value from the request params
    navigateAction = (String) facesContext.getExternalContext().getRequestParameterMap().get("page:navSelect");
View Full Code Here

  }

  public static Object resolveVariable(FacesContext context, String variable) {
    Application application = context.getApplication();
    VariableResolver variableResolver = application.getVariableResolver();
    return variableResolver.resolveVariable(context, variable);
  }

  /**
   * Clears the value of the variable.
   * Useful for cleaning up e.g. a session or application variable
View Full Code Here

        ELResolver elResolver = mocksControl.createMock(ELResolver.class);
        expect(mockApp.getELResolver()).andReturn(elResolver);
        context.setELContext(new MockELContext());
        expect(elResolver.getValue(eq(context.getELContext()), isNull(), eq("xxx"))).andReturn("testValue");
        mocksControl.replay();
        assertEquals("testValue", variableResolver.resolveVariable(context, "xxx"));
    }

    private void assertGetResourceBundleWithLocale(final Locale expectedLocale)
    {
        final String var = "test";
View Full Code Here

        ELResolver elResolver = mocksControl.createMock(ELResolver.class);
        expect(mockApp.getELResolver()).andReturn(elResolver);
        context.setELContext(new MockELContext());
        expect(elResolver.getValue(eq(context.getELContext()), isNull(), eq("xxx"))).andReturn("testValue");
        mocksControl.replay();
        assertEquals("testValue", variableResolver.resolveVariable(context, "xxx"));
    }

    private void assertGetResourceBundleWithLocale(final Locale expectedLocale)
    {
        final String var = "test";
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.