protected FacesBackingBean loadFacesBackingBean ( RequestContext requestContext , String backingClassName ) { try { Class backingClass = null ; try { backingClass = getFacesBackingBeanClass ( backingClassName ) ; } catch ( ClassNotFoundException e ) { // ignore -- we deal with this and log this immediately below. getFacesBackingBeanClass() by default // does not throw this exception, but a derived version might. } if ( backingClass == null ) { if ( _log . isTraceEnabled ( ) ) { _log . trace ( "No backing bean class " + backingClassName + " found for request " + requestContext . getHttpRequest ( ) . getRequestURI ( ) ) ; } } else { AnnotationReader annReader = AnnotationReader . getAnnotationReader ( backingClass , getServletContext ( ) ) ; if ( annReader . getJpfAnnotation ( backingClass , "FacesBacking" ) != null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Found backing class " + backingClassName + " for request " + requestContext . getHttpRequest ( ) . getRequestURI ( ) + "; creating a new instance." ) ; } return getFacesBackingBeanInstance ( backingClass ) ; } else { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Found matching backing class " + backingClassName + " for request " + requestContext . getHttpRequest ( ) . getRequestURI ( ) + ", but it does not have the " + ANNOTATION_QUALIFIER + "FacesBacking" + " annotation." ) ; } } } } catch ( InstantiationException e ) { _log . error ( "Could not create backing bean instance of " + backingClassName , e ) ; } catch ( IllegalAccessException e ) { _log . error ( "Could not create backing bean instance of " + backingClassName , e ) ; } return null ; }
Load a backing bean associated with the JavaServer Faces page for a request .