struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ced...@apache.org
Subject cvs commit: jakarta-struts/src/share/org/apache/struts/tiles TilesServlet.java
Date Fri, 19 Jul 2002 09:40:22 GMT
cedric      2002/07/19 02:40:22

  Modified:    src/share/org/apache/struts/tiles TilesServlet.java
  Log:
  Update initialization method
  
  Revision  Changes    Path
  1.2       +30 -19    jakarta-struts/src/share/org/apache/struts/tiles/TilesServlet.java
  
  Index: TilesServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/TilesServlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TilesServlet.java	25 Jun 2002 03:14:49 -0000	1.1
  +++ TilesServlet.java	19 Jul 2002 09:40:22 -0000	1.2
  @@ -87,25 +87,36 @@
        * @exception ServletException if we cannot configure ourselves correctly
        */
     public void init() throws ServletException
  +  {
  +  log(  "Start Tiles initialization");
  +  System.out.println( "Start Tiles initialization" );
  +  super.init();
  +
  +    // Create tiles definitions config object
  +  DefinitionsFactoryConfig factoryConfig = new DefinitionsFactoryConfig();
  +    // Get init parameters from web.xml files
  +  try
  +    {
  +    DefinitionsUtil.populateDefinitionsFactoryConfig(factoryConfig, getServletConfig());
  +    }
  +   catch(Exception ex)
       {
  -      log(  "Start Tiles initialization");
  -      System.out.println( "Start Tiles initialization" );
  -    super.init();
  +    throw new ServletException( "Can't populate DefinitionsFactoryConfig class from 'web.xml':
" + ex.getMessage() );
  +    }
   
  -       // init component instances
  -    try
  -      {
  -      System.out.println( "Start try" );
  -      DefinitionsUtil.createDefinitionsFactory(  getServletContext(), getServletConfig()
);
  -      log(  "Tiles Factory loaded");
  -      }
  -     catch( DefinitionsFactoryException ex )
  -      {
  +  try
  +    {
  +    System.out.println( "Try to load Tiles factory" );
  +    DefinitionsUtil.createDefinitionsFactory(getServletContext(), factoryConfig );
  +    log(  "Tiles Factory loaded");
  +    }
  +   catch( DefinitionsFactoryException ex )
  +    {
         log(  "Tiles Factory load fail !", ex);
  -      throw new ServletException(ex );
  -      }
  -
  +    throw new ServletException( ex );
       }
  +
  +  }
   
   
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message