public static void initJavaControls ( HttpServletRequest request , HttpServletResponse response , ServletContext servletContext , PageFlowManagedObject controlClient ) throws ControlFieldInitializationException { Class controlClientClass = controlClient . getClass ( ) ; // // First, just return if there are no annotated Control fields. This saves us from having to catch a // (wrapped) ClassNotFoundException for the control client initializer if we were to simply call // Controls.initializeClient(). // Map controlFields = getAccessibleControlFieldAnnotations ( controlClientClass , servletContext ) ; if ( controlFields . isEmpty ( ) ) { if ( LOG . isTraceEnabled ( ) ) LOG . trace ( "No control field annotations were found for " + controlClient ) ; PageFlowControlContainer pfcc = PageFlowControlContainerFactory . getControlContainer ( request , servletContext ) ; pfcc . beginContextOnPageFlow ( controlClient , request , response , servletContext ) ; return ; } request = PageFlowUtils . unwrapMultipart ( request ) ; PageFlowControlContainer pfcc = PageFlowControlContainerFactory . getControlContainer ( request , servletContext ) ; pfcc . createAndBeginControlBeanContext ( controlClient , request , response , servletContext ) ; ControlBeanContext beanContext = pfcc . getControlContainerContext ( controlClient ) ; assert beanContext != null : "ControlBeanContext was not initialized by PageFlowRequestProcessor" ; try { if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "Initializing control client " + controlClient ) ; Controls . initializeClient ( null , controlClient , beanContext ) ; } catch ( Exception e ) { LOG . error ( "Exception occurred while initializing controls" , e ) ; throw new ControlFieldInitializationException ( controlClientClass . getName ( ) , controlClient , e ) ; } }
Initialize all null member variables that are Java Controls .