Class EventDispatcher

java.lang.Object
fr.paris.lutece.portal.web.cdi.mvc.event.EventDispatcher

@ApplicationScoped public class EventDispatcher extends Object
Central dispatcher for firing CDI MVC-related events during the request lifecycle.

This class allows external components to observe and react to different moments in the MVC controller flow, such as before the controller is executed, after the view is processed, or just before a redirection occurs.

Events dispatched include:

  • Constructor Details

    • EventDispatcher

      public EventDispatcher()
  • Method Details

    • fireBeforeControllerEvent

      public BeforeControllerEvent fireBeforeControllerEvent(Method invokedMethod, boolean isBackOffice, MvcEvent.ControllerInvocationType controllerInvocationType, boolean isSecurityTokenEnabled)
      Fires a BeforeControllerEvent before the controller view and action has been processed.

      This allows observers to modify request context, set attributes, or perform validation before the controller method runs.

      Parameters:
      invokedMethod - controller method that is about to be invoked
      stIsBackOffice - Indicates whether the current request is in the back-office (BO) context or in the FO
      Returns:
      the dispatched BeforeControllerEvent instance
    • fireAfterProcessViewEvent

      public AfterProcessViewEvent fireAfterProcessViewEvent()
      Fires an AfterProcessViewEvent after the view has been processed.

      Observers may use this hook to inject additional content, perform logging, or clean up temporary data.

      Returns:
      the dispatched AfterProcessViewEvent instance
    • fireControllerRedirectEvent

      public ControllerRedirectEvent fireControllerRedirectEvent(UrlItem uri)
      Fires a ControllerRedirectEvent just before a redirect is performed.

      This allows observers to modify the redirect target URL or perform logic based on the target destination.

      Parameters:
      uri - the UrlItem representing the redirect destination
      Returns:
      the dispatched ControllerRedirectEvent instance