javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-1839

ViewScoped @PreDestroy not called on session expiry

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.1.0
    • Fix Version/s: unscheduled
    • Component/s: managed bean
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,839

      Description

      Using a simple test application with a ViewScoped ManagedBean and a
      SessionScoped ManagedBean, upon session expiry the SessionScoped @PreDestroy is
      called, but the ViewScoped @PreDestroy is not.

        Activity

        Hide
        Ed Burns added a comment -

        Section 5.4.1 of the spec pdf document states:

        In the case of a managed bean placed in view scope, methods annotated with
        @PreDestroy must only be called when the view scope is destroyed. See the javadoc for
        FacesContext.setViewRoot()

        The javadoc for setViewRoot() states:

        f the current UIViewRoot is non-null, and calling equals() on the argument root, passing the current
        UIViewRoot returns false, the clear method must be called on the Map returned from
        UIViewRoot.getViewMap().


        Therefore, there is no requirement to call @PreDestroy in this case. I'm closing this as WONTFIX.
        However, if you want to re-open this as a suggested spec change, I have granted you Observer
        membership in https://javaserverfaces-spec-public.dev.java.net/servlets/ProjectIssues . Please file an
        issue there.

        Show
        Ed Burns added a comment - Section 5.4.1 of the spec pdf document states: In the case of a managed bean placed in view scope, methods annotated with @PreDestroy must only be called when the view scope is destroyed. See the javadoc for FacesContext.setViewRoot() The javadoc for setViewRoot() states: f the current UIViewRoot is non-null, and calling equals() on the argument root, passing the current UIViewRoot returns false, the clear method must be called on the Map returned from UIViewRoot.getViewMap(). Therefore, there is no requirement to call @PreDestroy in this case. I'm closing this as WONTFIX. However, if you want to re-open this as a suggested spec change, I have granted you Observer membership in https://javaserverfaces-spec-public.dev.java.net/servlets/ProjectIssues . Please file an issue there.
        Hide
        jack_van_ooststroom added a comment -

        Do you see this as reasonable behavior, but not as required by the current
        specification?

        Show
        jack_van_ooststroom added a comment - Do you see this as reasonable behavior, but not as required by the current specification?
        Hide
        jack_van_ooststroom added a comment -

        Created an attachment (id=1310)
        Test application showing the issue.

        Show
        jack_van_ooststroom added a comment - Created an attachment (id=1310) Test application showing the issue.
        Hide
        Ed Burns added a comment -

        Since you asked for my opinion, I do see this as a nice feature.

        Show
        Ed Burns added a comment - Since you asked for my opinion, I do see this as a nice feature.
        Show
        jack_van_ooststroom added a comment - Issue has been filed: https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=905
        Hide
        Manfred Riem added a comment -

        Closing out resolved issue

        Show
        Manfred Riem added a comment - Closing out resolved issue

          People

          • Assignee:
            Ed Burns
            Reporter:
            jack_van_ooststroom
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: