|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
[jira] Created: (MYFACES-2396) @PreDestroy method of Bean in CustomScope not invoked@PreDestroy method of Bean in CustomScope not invoked
----------------------------------------------------- Key: MYFACES-2396 URL: https://issues.apache.org/jira/browse/MYFACES-2396 Project: MyFaces Core Issue Type: Bug Components: JSR-314 Affects Versions: 2.0.0-alpha Reporter: Jakob Korherr Testing the mojarra 2.0.1 sample "custom-bean-scope", MyFaces does NOT behave like Mojarra. The problem is that MyFaces does not propagate a PreDestroyCustomScopeEvent correctly. The following code is from the mojarra sample and shows how the event is published: public void notifyDestroy() { // notify interested parties that this scope is being // destroyed ScopeContext scopeContext = new ScopeContext(SCOPE_NAME, this); application.publishEvent(FacesContext.getCurrentInstance(), PreDestroyCustomScopeEvent.class, scopeContext); } However, the @PreDestroy method of the Bean, which is stored in the scope, is not invoked. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (MYFACES-2396) @PreDestroy method of Bean in CustomScope not invoked[ https://issues.apache.org/jira/browse/MYFACES-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774293#action_12774293 ] Jakob Korherr commented on MYFACES-2396: ---------------------------------------- Testing @PreDestroy with a managed bean in session scope, I found out that @PreDestroy also does not work on managed beans in "normal" scopes. The following action removes the bean "myBean" from the sessionMap: public String clearScope() { FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove("myBean"); return ""; } On mojarra @PreDestroy is invoked, on MyFaces it is not. > @PreDestroy method of Bean in CustomScope not invoked > ----------------------------------------------------- > > Key: MYFACES-2396 > URL: https://issues.apache.org/jira/browse/MYFACES-2396 > Project: MyFaces Core > Issue Type: Bug > Components: JSR-314 > Affects Versions: 2.0.0-alpha > Reporter: Jakob Korherr > > Testing the mojarra 2.0.1 sample "custom-bean-scope", MyFaces does NOT behave like Mojarra. > The problem is that MyFaces does not propagate a PreDestroyCustomScopeEvent correctly. The following code is from the mojarra sample and shows how the event is published: > public void notifyDestroy() { > // notify interested parties that this scope is being > // destroyed > ScopeContext scopeContext = new ScopeContext(SCOPE_NAME, this); > application.publishEvent(FacesContext.getCurrentInstance(), PreDestroyCustomScopeEvent.class, scopeContext); > } > However, the @PreDestroy method of the Bean, which is stored in the scope, is not invoked. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (MYFACES-2396) @PreDestroy method of Bean in CustomScope not invoked[ https://issues.apache.org/jira/browse/MYFACES-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12777110#action_12777110 ] Jakob Korherr commented on MYFACES-2396: ---------------------------------------- It seems like the origin of this issue is that all MyFacesXXXListeners in org.apache.myfaces.webapp created by Dennis Byrne are not registered in webxml. For example: If you manually register org.apache.myfaces.webapp.MyFacesHttpSessionAttributeListener, @PreDestroy is invoked correctly on all SessionScoped managed beans. > @PreDestroy method of Bean in CustomScope not invoked > ----------------------------------------------------- > > Key: MYFACES-2396 > URL: https://issues.apache.org/jira/browse/MYFACES-2396 > Project: MyFaces Core > Issue Type: Bug > Components: JSR-314 > Affects Versions: 2.0.0-alpha > Reporter: Jakob Korherr > > Testing the mojarra 2.0.1 sample "custom-bean-scope", MyFaces does NOT behave like Mojarra. > The problem is that MyFaces does not propagate a PreDestroyCustomScopeEvent correctly. The following code is from the mojarra sample and shows how the event is published: > public void notifyDestroy() { > // notify interested parties that this scope is being > // destroyed > ScopeContext scopeContext = new ScopeContext(SCOPE_NAME, this); > application.publishEvent(FacesContext.getCurrentInstance(), PreDestroyCustomScopeEvent.class, scopeContext); > } > However, the @PreDestroy method of the Bean, which is stored in the scope, is not invoked. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (MYFACES-2396) @PreDestroy method of Bean in CustomScope not invoked[ https://issues.apache.org/jira/browse/MYFACES-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779500#action_12779500 ] Leonardo Uribe commented on MYFACES-2396: ----------------------------------------- I only have one comments about this patch. Add other listener in myfaces core tld could cause problems, because there is no warrant about the execution order of those listeners. The best is refactor a little bit myfaces startup listener and delegate to a class that deal with this (ManagedBeanDestroyerListener). > @PreDestroy method of Bean in CustomScope not invoked > ----------------------------------------------------- > > Key: MYFACES-2396 > URL: https://issues.apache.org/jira/browse/MYFACES-2396 > Project: MyFaces Core > Issue Type: Bug > Components: JSR-314 > Affects Versions: 2.0.0-alpha > Reporter: Jakob Korherr > Attachments: myfaces_2396_proposal.patch > > > Testing the mojarra 2.0.1 sample "custom-bean-scope", MyFaces does NOT behave like Mojarra. > The problem is that MyFaces does not propagate a PreDestroyCustomScopeEvent correctly. The following code is from the mojarra sample and shows how the event is published: > public void notifyDestroy() { > // notify interested parties that this scope is being > // destroyed > ScopeContext scopeContext = new ScopeContext(SCOPE_NAME, this); > application.publishEvent(FacesContext.getCurrentInstance(), PreDestroyCustomScopeEvent.class, scopeContext); > } > However, the @PreDestroy method of the Bean, which is stored in the scope, is not invoked. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Commented: (MYFACES-2396) @PreDestroy method of Bean in CustomScope not invoked[ https://issues.apache.org/jira/browse/MYFACES-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779553#action_12779553 ] Jakob Korherr commented on MYFACES-2396: ---------------------------------------- I also thought about that. The only thing, which I did not like about it, is that the StartupServletContextListener would also be a HttpSessionListener, RequestListener,.... and so he does more than his name "StartupServletContextListener" tells us. But I suppose this is better than the registration of a second Listener. I'll change the patch! > @PreDestroy method of Bean in CustomScope not invoked > ----------------------------------------------------- > > Key: MYFACES-2396 > URL: https://issues.apache.org/jira/browse/MYFACES-2396 > Project: MyFaces Core > Issue Type: Bug > Components: JSR-314 > Affects Versions: 2.0.0-alpha > Reporter: Jakob Korherr > Attachments: myfaces_2396_proposal.patch > > > Testing the mojarra 2.0.1 sample "custom-bean-scope", MyFaces does NOT behave like Mojarra. > The problem is that MyFaces does not propagate a PreDestroyCustomScopeEvent correctly. The following code is from the mojarra sample and shows how the event is published: > public void notifyDestroy() { > // notify interested parties that this scope is being > // destroyed > ScopeContext scopeContext = new ScopeContext(SCOPE_NAME, this); > application.publishEvent(FacesContext.getCurrentInstance(), PreDestroyCustomScopeEvent.class, scopeContext); > } > However, the @PreDestroy method of the Bean, which is stored in the scope, is not invoked. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
|
|
[jira] Updated: (MYFACES-2396) @PreDestroy method of Bean in CustomScope not invoked[ https://issues.apache.org/jira/browse/MYFACES-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jakob Korherr updated MYFACES-2396: ----------------------------------- Status: Patch Available (was: Open) > @PreDestroy method of Bean in CustomScope not invoked > ----------------------------------------------------- > > Key: MYFACES-2396 > URL: https://issues.apache.org/jira/browse/MYFACES-2396 > Project: MyFaces Core > Issue Type: Bug > Components: JSR-314 > Affects Versions: 2.0.0-alpha > Reporter: Jakob Korherr > Attachments: myfaces-2396-final.patch, myfaces_2396_proposal.patch > > > Testing the mojarra 2.0.1 sample "custom-bean-scope", MyFaces does NOT behave like Mojarra. > The problem is that MyFaces does not propagate a PreDestroyCustomScopeEvent correctly. The following code is from the mojarra sample and shows how the event is published: > public void notifyDestroy() { > // notify interested parties that this scope is being > // destroyed > ScopeContext scopeContext = new ScopeContext(SCOPE_NAME, this); > application.publishEvent(FacesContext.getCurrentInstance(), PreDestroyCustomScopeEvent.class, scopeContext); > } > However, the @PreDestroy method of the Bean, which is stored in the scope, is not invoked. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
| Free embeddable forum powered by Nabble | Forum Help |