TilesContextBeanELResolver extends ELResolver { @Override public Object getValue(ELContext context, Object base, Object property) { if (base != null) { return null; } Object retValue = findObjectByProperty(context, property); if (retValue != null) { context.setPropertyResolved(true); } return retValue; }  @Override Class<?> getCommonPropertyType(ELContext context, Object base); @Override Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
            Object base); @Override Class<?> getType(ELContext context, Object base, Object property); @Override Object getValue(ELContext context, Object base, Object property); @Override boolean isReadOnly(ELContext context, Object base, Object property); @Override void setValue(ELContext context, Object base, Object property,
            Object value);  }
@Test public void testGetValue() { Map<String, Object> requestScope = new HashMap<String, Object>(); Map<String, Object> sessionScope = new HashMap<String, Object>(); Map<String, Object> applicationScope = new HashMap<String, Object>(); requestScope.put("object1", "value"); sessionScope.put("object2", new Integer(1)); applicationScope.put("object3", new Float(2.0)); Request request = createMock(Request.class); expect(request.getContext("request")).andReturn(requestScope) .anyTimes(); expect(request.getContext("session")).andReturn(sessionScope) .anyTimes(); ApplicationContext applicationContext = createMock(ApplicationContext.class); expect(request.getContext("application")).andReturn( applicationScope).anyTimes(); expect(request.getAvailableScopes()).andReturn( Arrays.asList(new String[] { "request", "session", "application" })) .anyTimes(); replay(request, applicationContext); ELContext context = new ELContextImpl(resolver); context.putContext(Request.class, request); context.putContext(ApplicationContext.class, applicationContext); assertEquals("The value is not correct", "value", resolver.getValue( context, null, "object1")); assertEquals("The value is not correct", new Integer(1), resolver .getValue(context, null, "object2")); assertEquals("The value is not correct", new Float(2.0), resolver .getValue(context, null, "object3")); assertNull(resolver.getValue(context, new Integer(1), "whatever")); }