public void attributeReplaced(ServletRequestAttributeEvent srae) { // use this phase attribute as an indicator of whether // we are actively working on a request PortletPhase phase = (PortletPhase) srae.getServletRequest().getAttribute(Bridge.PORTLET_LIFECYCLE_PHASE); // If in an action this means the attribute has been replaced before we have // saved the action scope -- since the managed bean has been informed we are // running in a portlet environment it should have ignored the PreDestroy. // To make up for this we call its BridgePredestroy if (phase != null && phase != PortletPhase.RENDER_PHASE) { notifyPreDestroy(srae.getValue()); // in outerclass (BridgeImpl) } }
public void attributeRemoved(ServletRequestAttributeEvent srae) { // use this phase attribute as an indicator of whether // we are actively working on a request PortletPhase phase = (PortletPhase) srae.getServletRequest().getAttribute(Bridge.PORTLET_LIFECYCLE_PHASE); // If not in a render this means the attribute has been removed before we have // saved the request scope -- since the managed bean has been informed we are // running in a portlet environment it should have ignored the PreDestroy. // To make up for this we call its BridgePredestroy if (phase != null && phase != PortletPhase.RENDER_PHASE) { notifyPreDestroy(srae.getValue()); // in outerclass (BridgeImpl) } }
PortletPhase phase = (PortletPhase) srae.getServletRequest().getAttribute(Bridge.PORTLET_LIFECYCLE_PHASE); isExcludedFromBridgeRequestScope(srae.getName(), srae.getValue(), (List<String>) srae.getServletRequest() .getAttribute(PREEXISTING_ATTRIBUTE_NAMES)))
/** * <p>Respond to a request scope attribute being replaced. * If the old value was an {@link AbstractRequestBean}, * call its <code>destroy()</code> method. If the new value is an * {@link AbstractRequestBean}, call its <code>init()</code> method.</p> * * @param event Event to be processed */ public void attributeReplaced(ServletRequestAttributeEvent event) { Object value = event.getValue(); if (value != null) { fireRequestDestroy(value); } value = event.getServletRequest().getAttribute(event.getName()); if (value != null) { fireRequestInit(value); } }
/** * Notification that an attribute was replaced on the * servlet request. Called after the attribute is replaced. * * @param event the notification event */ public void attributeReplaced(ServletRequestAttributeEvent event) { String attrName = event.getName(); Object newValue = event.getServletRequest().getAttribute(attrName); // perhaps a bit paranoid, but since the javadocs are a bit vague, // only handle the event if oldValue and newValue are not the // exact same object //noinspection ObjectEquality if (event.getValue() != newValue) { handleAttributeEvent(attrName, event.getValue(), ELUtils.Scope.REQUEST); } }
/** * Notification that an attribute was replaced on the servlet request. Called after the * attribute is replaced. * * @param event the notification event */ public void attributeReplaced(ServletRequestAttributeEvent event) { String attrName = event.getName(); Object newValue = event.getServletRequest().getAttribute(attrName); // perhaps a bit paranoid, but since the javadocs are a bit vague, // only handle the event if oldValue and newValue are not the // exact same object // noinspection ObjectEquality if (event.getValue() != newValue) { handleAttributeEvent(attrName, event.getValue(), ELUtils.Scope.REQUEST); } }
/** * Notification that an attribute was replaced on the servlet request. Called after the * attribute is replaced. * * @param event the notification event */ public void attributeReplaced(ServletRequestAttributeEvent event) { String attrName = event.getName(); Object newValue = event.getServletRequest().getAttribute(attrName); // perhaps a bit paranoid, but since the javadocs are a bit vague, // only handle the event if oldValue and newValue are not the // exact same object // noinspection ObjectEquality if (event.getValue() != newValue) { handleAttributeEvent(attrName, event.getValue(), ELUtils.Scope.REQUEST); } }
/** * Notification that an attribute was replaced on the servlet request. Called after the * attribute is replaced. * * @param event the notification event */ public void attributeReplaced(ServletRequestAttributeEvent event) { String attrName = event.getName(); Object newValue = event.getServletRequest().getAttribute(attrName); // perhaps a bit paranoid, but since the javadocs are a bit vague, // only handle the event if oldValue and newValue are not the // exact same object // noinspection ObjectEquality if (event.getValue() != newValue) { handleAttributeEvent(attrName, event.getValue(), ELUtils.Scope.REQUEST); } }
/** * Notification that an attribute was replaced on the * servlet request. Called after the attribute is replaced. * * @param event the notification event */ public void attributeReplaced(ServletRequestAttributeEvent event) { String attrName = event.getName(); Object newValue = event.getServletRequest().getAttribute(attrName); // perhaps a bit paranoid, but since the javadocs are a bit vague, // only handle the event if oldValue and newValue are not the // exact same object //noinspection ObjectEquality if (event.getValue() != newValue) { handleAttributeEvent(attrName, event.getValue(), ELUtils.Scope.REQUEST); } }
public void attributeRemoved(ServletRequestAttributeEvent evt) { final String name = evt.getName(); if (!shallIgnore(name)) { final Execution exec = Executions.getCurrent(); if (exec instanceof ExecutionImpl && evt.getServletRequest().equals(exec.getNativeRequest())) ((ExecutionImpl) exec).getScopeListeners().notifyRemoved(name); } }
ServletRequest servletRequest = servletRequestAttributeEvent.getServletRequest(); PortletPhase phase = (PortletPhase) servletRequest.getAttribute(Bridge.PORTLET_LIFECYCLE_PHASE);
/** * <p>Respond to a request scope attribute being replaced. * If the old value was an {@link AbstractRequestBean}, * call its <code>destroy()</code> method. If the new value is an * {@link AbstractRequestBean}, call its <code>init()</code> method.</p> * * @param event Event to be processed */ public void attributeReplaced(ServletRequestAttributeEvent event) { if (log.isDebugEnabled()) { log.debug("ServletRequestAttributeReplaced(" + event.getName() + "," + event.getValue() + "," + event.getServletRequest().getAttribute(event.getName()) + ")"); } // Delegate to the Tiger Extensions instance if it exists LifecycleListener tiger = tiger(); if (tiger != null) { tiger.attributeReplaced(event); return; // Tiger logic replaces our own } Object value = event.getValue(); if (value != null) { fireRequestDestroy(value); } value = event.getServletRequest().getAttribute(event.getName()); if (value != null) { fireRequestInit(value); } }
public void attributeReplaced(ServletRequestAttributeEvent evt) { final String name = evt.getName(); if (!shallIgnore(name)) { final Execution exec = Executions.getCurrent(); if (exec instanceof ExecutionImpl && evt.getServletRequest().equals(exec.getNativeRequest())) ((ExecutionImpl) exec).getScopeListeners().notifyReplaced(name, evt.getValue()); } } }
ServletRequest servletRequest = servletRequestAttributeEvent.getServletRequest(); PortletPhase phase = (PortletPhase) servletRequest.getAttribute(Bridge.PORTLET_LIFECYCLE_PHASE);
public void attributeAdded(ServletRequestAttributeEvent evt) { final String name = evt.getName(); if (!shallIgnore(name)) { final Execution exec = Executions.getCurrent(); if (exec instanceof ExecutionImpl && evt.getServletRequest().equals(exec.getNativeRequest())) ((ExecutionImpl) exec).getScopeListeners().notifyAdded(name, evt.getValue()); } }