[jboss-cvs] jboss-seam/src/main/org/jboss/seam/contexts ...

Gavin King gavin.king at jboss.com
Thu Mar 8 12:16:16 EST 2007


  User: gavin   
  Date: 07/03/08 12:16:16

  Modified:    src/main/org/jboss/seam/contexts  Lifecycle.java
  Log:
  fix broken captcha functionality
  fix NPEs in conversation management from ResourceServlet
  
  Revision  Changes    Path
  1.85      +22 -14    jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Lifecycle.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -b -r1.84 -r1.85
  --- Lifecycle.java	7 Mar 2007 05:20:40 -0000	1.84
  +++ Lifecycle.java	8 Mar 2007 17:16:16 -0000	1.85
  @@ -28,7 +28,7 @@
   /**
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.84 $
  + * @version $Revision: 1.85 $
    */
   public class Lifecycle
   {
  @@ -169,7 +169,8 @@
            }
         }
   
  -      if ( !component.getScope().getContext().isSet( component.getName() ) ) {
  +      if ( !component.getScope().getContext().isSet( component.getName() ) ) 
  +      {
            log.info("starting up: " + component.getName());
            component.newInstance();
         }
  @@ -305,7 +306,8 @@
         Contexts.applicationContext.set(null);
      }
   
  -   public static void endRequest(ExternalContext externalContext) {
  +   public static void endRequest(ExternalContext externalContext) 
  +   {
   
         log.debug("After render response, destroying contexts");
         try
  @@ -328,7 +330,8 @@
         log.debug( "<<< End web request" );
      }
   
  -   public static void endRequest() {
  +   public static void endRequest() 
  +   {
   
         log.debug("After request, destroying contexts");
         
  @@ -344,7 +347,8 @@
         log.debug( "<<< End web request" );
      }
   
  -   public static void endRequest(HttpSession session) {
  +   public static void endRequest(HttpSession session) 
  +   {
   
         log.debug("After request, destroying contexts");
   
  @@ -357,7 +361,6 @@
               clearThreadlocals();
               ContextAdaptor.getSession(session).invalidate(); //huh? we create a session just to invalidate it?
               //actual session context will be destroyed from the listener
  -
            }
         }
         finally
  @@ -369,7 +372,8 @@
   
      }
   
  -   private static void clearThreadlocals() {
  +   private static void clearThreadlocals() 
  +   {
         Contexts.eventContext.set(null);
         Contexts.pageContext.set(null);
         Contexts.sessionContext.set(null);
  @@ -415,11 +419,11 @@
               Contexts.getConversationContext().flush();
            }
   
  -      }
  -      
         //uses the event and session contexts
         Manager.instance().unlockConversation();
   
  +      }
  +      
         if ( Contexts.isSessionContextActive() )
         {
            log.debug("flushing session context");
  @@ -474,7 +478,8 @@
      private static ThreadLocal<ServletRequest> servletRequest = new ThreadLocal<ServletRequest>();
      private static ServletContext servletContext;
   
  -   public static ServletContext getServletContext() {
  +   public static ServletContext getServletContext() 
  +   {
         if (servletContext==null)
         {
            throw new IllegalStateException("Attempted to invoke a Seam component outside the context of a web application");
  @@ -482,15 +487,18 @@
         return servletContext;
      }
   
  -   public static void setServletContext(ServletContext servletContext) {
  +   public static void setServletContext(ServletContext servletContext) 
  +   {
         Lifecycle.servletContext = servletContext;
      }
   
  -   public static ServletRequest getServletRequest() {
  +   public static ServletRequest getServletRequest() 
  +   {
         return servletRequest.get();
      }
   
  -   public static void setServletRequest(ServletRequest servletRequest) {
  +   public static void setServletRequest(ServletRequest servletRequest) 
  +   {
         Lifecycle.servletRequest.set(servletRequest);
      }
   
  
  
  



More information about the jboss-cvs-commits mailing list