dev@javaserverfaces.java.net

Re: [Fwd: [REVIEW] Enhance ManagedBean annotation lifecycle handling]

From: Ed Burns <ed.burns_at_sun.com>
Date: Tue, 25 Oct 2005 13:17:36 -0700

>>>>> On Tue, 25 Oct 2005 12:12:54 +0800, Ryan Lubke <Ryan.Lubke_at_Sun.COM> said:

RL> Use *AttributeListeners to handle ManagedBean preDestory lifecycle
RL> instead of users
RL> having to use ExternalContext maps.


RL> SECTION: Modified Files
RL> ----------------------------

RL> M src/com/sun/faces/config/ConfigureListener.java
RL> - Implement ServletRequestAttributeListener, HttpSessionAttributeListener,
RL> ServletContextAttributeListener
RL> - For the 'remove' case, call through to
RL> ApplicationAssociate.handlePreDestroy()
RL> - In the 'replace' case, only call through to
RL> ApplicationAssociate.handlePreDestroy()
RL> if the old/new values are different.

RL> + public void attributeReplaced(ServletRequestAttributeEvent event) {
RL> +
RL> + String attrName = event.getName();
RL> + Object newValue = event.getServletRequest().getAttribute(attrName);

Shouldn't this local variable be called oldValue? The same goes for the
other scopes.

Otherwise, r=edburns


Ed
-- 
| ed.burns_at_sun.com  | {home: 407 869 9587, office: 408 884 9519 OR x31640}
| homepage:         | http://purl.oclc.org/NET/edburns/
| aim: edburns0sunw | iim: ed.burns_at_sun.com