/** * Finds an object in request, session or application scope, in this order. * * @param context The context to use. * @param property The property used as an attribute name. * @return The found bean, if it exists, or <code>null</code> otherwise. * @since 2.2.1 */ 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; }