class AnyScopePropertyAccessor implements PropertyAccessor {

    @Override
    public String getSourceAccessor(OgnlContext context, Object target,
            Object index) {
        Request request = (Request) target;
        String attributeName = (String) index;
        for (String scopeName : request.getAvailableScopes()) {
            Map<String, Object> scope = request.getContext(scopeName);
            if (scope.containsKey(attributeName)) {
                return ".getContext(\"" + scopeName + "\").get(index)";
            }
        }
        return null;
    }

}