Skip to content
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
ren-zhijun-oracle opened this issue Oct 19, 2010 · 11 comments
Closed

ViewScoped @PreDestroy not called on session expiry #1843

ren-zhijun-oracle opened this issue Oct 19, 2010 · 11 comments

Comments

@ren-zhijun-oracle
Copy link
Contributor

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]

@ren-zhijun-oracle
Copy link
Contributor Author

@javaserverfaces Commented
Reported by jack_van_ooststroom

@ren-zhijun-oracle
Copy link
Contributor Author

@javaserverfaces Commented
@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.

@ren-zhijun-oracle
Copy link
Contributor Author

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

@ren-zhijun-oracle
Copy link
Contributor Author

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

@ren-zhijun-oracle
Copy link
Contributor Author

@javaserverfaces Commented
File: jsf-test.war
Attached By: jack_van_ooststroom

@ren-zhijun-oracle
Copy link
Contributor Author

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

@ren-zhijun-oracle
Copy link
Contributor Author

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

@ren-zhijun-oracle
Copy link
Contributor Author

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

@ren-zhijun-oracle
Copy link
Contributor Author

@javaserverfaces Commented
@manfredriem said:
Closing out resolved issue

@ren-zhijun-oracle
Copy link
Contributor Author

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

@ren-zhijun-oracle
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant