class TilesContextBeanELResolver extends ELResolver {

    protected Object findObjectByProperty(ELContext context, Object property) {
        Object retValue = null;

        Request request = (Request) context
                .getContext(Request.class);

        String prop = property.toString();

        String[] scopes = request.getAvailableScopes().toArray(new String[0]);
        int i = 0;
        do {
            retValue = getObject(request.getContext(scopes[i]), prop);
            i++;
        } while (retValue == null && i < scopes.length);

        return retValue;
    }

}