private static void registerAjaxOperation ( final AjaxOperation operation ) { UIContext uic = UIContextHolder . getCurrentPrimaryUIContext ( ) ; if ( uic == null ) { throw new SystemException ( "No User Context Available to Register AJAX Operations." ) ; } Map < String , AjaxOperation > operations = ( Map < String , AjaxOperation > ) uic . getFwkAttribute ( AJAX_OPERATIONS_SESSION_KEY ) ; if ( operations == null ) { operations = new HashMap <> ( ) ; uic . setFwkAttribute ( AJAX_OPERATIONS_SESSION_KEY , operations ) ; } operations . put ( operation . getTriggerId ( ) , operation ) ; }
The Ajax servlet needs access to the AjaxOperation Store the operation in the user context using the trigger Id as this will be present in the Servlet HttpRequest . agreed key . The ajax id is passed in the url to the servlet so it can then access the context .