New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ViewScoped @PreDestroy not called on session expiry #1843

Closed
javaserverfaces opened this Issue Oct 19, 2010 · 10 comments

Comments

Projects
None yet
2 participants
@javaserverfaces
Owner

javaserverfaces commented Oct 19, 2010

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.

Environment

Operating System: All
Platform: All

Affected Versions

[2.1.0]

@javaserverfaces

This comment has been minimized.

Show comment
Hide comment
@javaserverfaces

javaserverfaces Oct 19, 2010

Owner

Reported by jack_van_ooststroom

Owner

javaserverfaces commented Oct 19, 2010

Reported by jack_van_ooststroom

@javaserverfaces

This comment has been minimized.

Show comment
Hide comment
@javaserverfaces

javaserverfaces Oct 20, 2010

Owner

@edburns said:
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.

Owner

javaserverfaces commented Oct 20, 2010

@edburns said:
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.

@javaserverfaces

This comment has been minimized.

Show comment
Hide comment
@javaserverfaces

javaserverfaces Oct 20, 2010

Owner

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

Owner

javaserverfaces commented Oct 20, 2010

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

@javaserverfaces

This comment has been minimized.

Show comment
Hide comment
@javaserverfaces

javaserverfaces Oct 20, 2010

Owner

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

Owner

javaserverfaces commented Oct 20, 2010

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

@javaserverfaces

This comment has been minimized.

Show comment
Hide comment
@javaserverfaces

javaserverfaces Oct 20, 2010

Owner

File: jsf-test.war
Attached By: jack_van_ooststroom

Owner

javaserverfaces commented Oct 20, 2010

File: jsf-test.war
Attached By: jack_van_ooststroom

@javaserverfaces

This comment has been minimized.

Show comment
Hide comment
@javaserverfaces

javaserverfaces Nov 1, 2010

Owner

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

Owner

javaserverfaces commented Nov 1, 2010

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

@javaserverfaces

This comment has been minimized.

Show comment
Hide comment
@javaserverfaces
Owner

javaserverfaces commented Nov 2, 2010

jack_van_ooststroom said:
Issue has been filed:
https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=905

@javaserverfaces

This comment has been minimized.

Show comment
Hide comment
@javaserverfaces

javaserverfaces Nov 2, 2010

Owner

Marked as won't fix on Tuesday, November 2nd 2010, 7:29:24 am

Owner

javaserverfaces commented Nov 2, 2010

Marked as won't fix on Tuesday, November 2nd 2010, 7:29:24 am

@javaserverfaces

This comment has been minimized.

Show comment
Hide comment
@javaserverfaces

javaserverfaces Mar 22, 2012

Owner

@manfredriem said:
Closing out resolved issue

Owner

javaserverfaces commented Mar 22, 2012

@manfredriem said:
Closing out resolved issue

@javaserverfaces

This comment has been minimized.

Show comment
Hide comment
@javaserverfaces

javaserverfaces May 2, 2017

Owner

This issue was imported from java.net JIRA JAVASERVERFACES-1839

Owner

javaserverfaces commented May 2, 2017

This issue was imported from java.net JIRA JAVASERVERFACES-1839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment