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

Gavin King gavin.king at jboss.com
Sun Feb 4 03:08:05 EST 2007


  User: gavin   
  Date: 07/02/04 03:08:05

  Modified:    src/main/org/jboss/seam/init  Initialization.java
  Log:
  back-compatible
  
  Revision  Changes    Path
  1.144     +8 -13     jboss-seam/src/main/org/jboss/seam/init/Initialization.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Initialization.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/init/Initialization.java,v
  retrieving revision 1.143
  retrieving revision 1.144
  diff -u -b -r1.143 -r1.144
  --- Initialization.java	4 Feb 2007 07:57:19 -0000	1.143
  +++ Initialization.java	4 Feb 2007 08:08:05 -0000	1.144
  @@ -53,7 +53,7 @@
   /**
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.143 $
  + * @version $Revision: 1.144 $
    */
   public class Initialization
   {
  @@ -72,9 +72,9 @@
      public Initialization(ServletContext servletContext)
      {
         this.servletContext = servletContext;
  -
         addNamespaces();
  -      initComponentsFromXmlDocument();
  +      initComponentsFromXmlDocument("/WEB-INF/components.xml");
  +      initComponentsFromXmlDocument("/WEB-INF/events.xml"); //deprecated
         initComponentsFromXmlDocuments();
         initPropertiesFromServletContext();
         initPropertiesFromResource();
  @@ -86,8 +86,7 @@
         Enumeration<URL> resources;
         try
         {
  -         resources = Thread.currentThread().getContextClassLoader().getResources(
  -                  "META-INF/components.xml");
  +         resources = Thread.currentThread().getContextClassLoader().getResources("META-INF/components.xml");
         }
         catch (IOException ioe)
         {
  @@ -111,16 +110,12 @@
   
      }
   
  -   private void initComponentsFromXmlDocument()
  -   {
  -      InputStream stream = Resources.getResourceAsStream("/WEB-INF/components.xml", servletContext);
  -      if (stream == null)
  +   private void initComponentsFromXmlDocument(String resource)
         {
  -         log.info("no /WEB-INF/components.xml file found");
  -      }
  -      else
  +      InputStream stream = Resources.getResourceAsStream(resource, servletContext);
  +      if (stream != null)
         {
  -         log.info("reading /WEB-INF/components.xml");
  +         log.info("reading " + resource);
            try
            {
               installComponentsFromXmlElements( XML.getRootElement(stream), getReplacements() );
  
  
  



More information about the jboss-cvs-commits mailing list