[jboss-jira] [JBoss JIRA] Created: (JBSEAM-331) NPE in PageContext.getCurrentReadableMap() and PageContext.getCurrentWritableMap(), using others PhaseListeners

Luiz Augusto Ruiz (JIRA) jira-events at jboss.com
Fri Aug 11 09:14:12 EDT 2006


NPE in PageContext.getCurrentReadableMap() and PageContext.getCurrentWritableMap(), using others PhaseListeners
---------------------------------------------------------------------------------------------------------------

                 Key: JBSEAM-331
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-331
             Project: JBoss Seam
          Issue Type: Patch
          Components: JSF
         Environment: JBoss 4.0.4-GA, JBoss Seam 1.0.1-GA, Ajax4Jsf  1.0 rc4
            Reporter: Luiz Augusto Ruiz


SeamPhaseListener.afterPhase() invokes Lifecycle.setPhaseId(null) after the phase INVOKE_APPLICATION(5). If exists other PhaseListener that is called after SeamPhaseListener, and use a variable, when the methods PageContext.getCurrent [Readable/Writeble] Map() are called the Null Pointer Exception occurs.
The patch checks for null PhaseId before use it.

----------------------------
   private Map getCurrentReadableMap()
   {
	  PhaseId phaseId = Lifecycle.getPhaseId();
	  if (null == phaseId) {
		  return nextPageMap;
	  }
      return phaseId.compareTo(PhaseId.INVOKE_APPLICATION) > 0 ?
            nextPageMap : previousPageMap;
   }

   private Map getCurrentWritableMap()
   {
	  PhaseId phaseId = Lifecycle.getPhaseId();
	  if (null == phaseId) {
		  return nextPageMap;
	  }
      return phaseId.compareTo(PhaseId.INVOKE_APPLICATION) < 0 ?
            previousPageMap : nextPageMap;
   }
-------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list