Package javax.faces.el

Examples of javax.faces.el.VariableResolver


    }

    @Test
    public void testGetVariableResolver() throws Exception
    {
        VariableResolver resolver = _mocksControl.createMock(VariableResolver.class);
        expect(_runtimeConfig.getVariableResolver()).andReturn(resolver).anyTimes();
        _mocksControl.replay();
        _testImpl.addFromRuntimeConfig(_resolvers);
        _mocksControl.verify();
       
View Full Code Here


    }

    @Test
    public void testGetVariableResolverChainHead() throws Exception
    {
        VariableResolver resolver = _mocksControl.createMock(VariableResolver.class);
        EasyMock.expect(_runtimeConfig.getVariableResolverChainHead()).andReturn(resolver).anyTimes();
        _mocksControl.replay();
        _testImpl.addFromRuntimeConfig(_resolvers);
        _mocksControl.verify();
       
View Full Code Here

        }
    }
   
    public void testGetVariableResolver() throws Exception
    {
        VariableResolver variableResolver = app.getVariableResolver();
        assertNotNull(variableResolver);
        IMocksControl mocksControl = EasyMock.createControl();
        Application mockApp = mocksControl.createMock(Application.class);
        context.setApplication(mockApp);       
        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"));
    }
View Full Code Here

    }

    @Test
    public void testGetVariableResolver() throws Exception
    {
        VariableResolver resolver = _mocksControl.createMock(VariableResolver.class);
        expect(_runtimeConfig.getVariableResolver()).andReturn(resolver).anyTimes();
        _mocksControl.replay();
        _testImpl.addFromRuntimeConfig(_resolvers);
        _mocksControl.verify();
       
View Full Code Here

    }

    @Test
    public void testGetVariableResolverChainHead() throws Exception
    {
        VariableResolver resolver = _mocksControl.createMock(VariableResolver.class);
        EasyMock.expect(_runtimeConfig.getVariableResolverChainHead()).andReturn(resolver).anyTimes();
        _mocksControl.replay();
        _testImpl.addFromRuntimeConfig(_resolvers);
        _mocksControl.verify();
       
View Full Code Here

    return logAndNavigate(null);
  }

  public String navigateAction() {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    VariableResolver resolver = facesContext.getApplication().getVariableResolver();
    Navigation navigation = (Navigation) resolver.resolveVariable(facesContext, "navigation");
    LOG.info("navigateAction = \"" + navigateAction + "\"");
    if (navigateAction == null) {
      return logAndNavigate(null);
    } else if ("both".equals(navigateAction)) {
      navigateAction = null;
View Full Code Here

    return logAndNavigate(null);
  }

  public String navigateAction() {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    VariableResolver resolver = facesContext.getApplication().getVariableResolver();
    Navigation navigation = (Navigation) resolver.resolveVariable(facesContext, "navigation");
    LOG.info("navigateAction = \"" + navigateAction + "\"");
    if (navigateAction == null) {
      return logAndNavigate(null);
    } else if ("both".equals(navigateAction)) {
      navigateAction = null;
View Full Code Here

                .getContext(FacesContext.class);
        ExternalContext econtext = fcontext.getExternalContext();
        String name = property.toString();

        ELContext elContext = fcontext.getELContext();
        VariableResolver vr = fcontext.getApplication().getVariableResolver();
        try
        {
            Object value = vr.resolveVariable(fcontext, name);
            if (value != null)
            {
                context.setPropertyResolved(true);
            }
            return value;
View Full Code Here

            throw new NullPointerException();
        }
        List names = parse(ref);

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

            throw new NullPointerException();
        }
        List names = parse(ref);

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

TOP

Related Classes of javax.faces.el.VariableResolver

Copyright © 2018 www.massapicom. 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.