Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-354

Inappropriate payload of the @Initialized(ConversationScoped.class) event

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 1.1.FD
    • 1.1.PFD
    • Contexts
    • None

      An event with qualifier @Initialized(ConversationScoped.class) is fired when the conversation context is initialized
      and an event with qualifier @Destroyed(ConversationScoped.class) is fired when the conversation is destroyed.

      The event payload is:
      • the conversation id if the conversation context is destroyed and is not associated with a current Servlet request, or
      • the ServletRequestEvent if the application is a web application deployed to a Servlet container, or
      • any java.lang.Object for other types of application.

      The conversation context is supposed to be activated in a container-provided filter with the name "CDI Conversation Filter". A Servlet Filter itself does not have access to a ServletRequestEvent instance (that is only available to ServletRequestListeners). Therefore, the implementation would either have to re-create the instance by combining ServletRequest and ServletContext or propagate the ServletRequestEvent from a ServletRequestListener.

      From an application point of view, ServletRequest is the only interesting property of ServletRequestEvent anyway. Therefore, I suggest to change the wording of the spec to specify ServletRequest (or HttpServletRequest) as the payload of @Initialized(ConversationScoped.class) and @Destroyed(ConversationScoped.class) events.

            pmuiratbleepbleep Pete Muir (Inactive)
            rhn-engineering-jharting Jozef Hartinger
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: