avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/java/org/apache/avalon/merlin/servlet MerlinServlet.java
Date Sun, 13 Apr 2003 02:44:24 GMT
mcconnell    2003/04/12 19:44:24

  Modified:    merlin/merlin-extensions/merlin-servlet/src/java/org/apache/avalon/merlin/servlet
                        MerlinServlet.java
  Log:
  Test for null context (can occur in container is not correctly defining the webapp context).
  
  Revision  Changes    Path
  1.2       +9 -0      avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/java/org/apache/avalon/merlin/servlet/MerlinServlet.java
  
  Index: MerlinServlet.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/java/org/apache/avalon/merlin/servlet/MerlinServlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MerlinServlet.java	7 Apr 2003 16:48:17 -0000	1.1
  +++ MerlinServlet.java	13 Apr 2003 02:44:24 -0000	1.2
  @@ -84,6 +84,13 @@
           {
               ClassLoader loader = Thread.currentThread().getContextClassLoader();
   
  +            if( getServletContext() == null )
  +            {
  +                final String error = 
  +                 "Cannot proceed. Container returned a null servlet context.";
  +                throw new ServletException( error );
  +            }
  +
               String homePath = getServletContext().getRealPath( "." );
               File home = new File( homePath );
   
  @@ -103,6 +110,8 @@
               m_kernel = new DefaultKernel();
               m_kernel.contextualize( context );
               m_kernel.initialize();
  +
  +            getServletContext().setAttribute( Block.BLOCK_KEY, getRootBlock() );
   
               log( "kernel established" );
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message