User: starksm 
  Date: 01/06/09 17:34:00

  Modified:    tomcat/src/main/org/jboss/tomcat Tag: Branch_2_2
                        EmbeddedTomcatServiceSX.java
  Log:
  Add EntityResolver for jboss-web.dtd and web.dtd
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +10 -21    
contrib/tomcat/src/main/org/jboss/tomcat/EmbeddedTomcatServiceSX.java
  
  Index: EmbeddedTomcatServiceSX.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/tomcat/src/main/org/jboss/tomcat/EmbeddedTomcatServiceSX.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- EmbeddedTomcatServiceSX.java      2001/05/24 15:36:40     1.1.2.1
  +++ EmbeddedTomcatServiceSX.java      2001/06/10 00:34:00     1.1.2.2
  @@ -22,10 +22,7 @@
   
   import javax.management.*;
   import javax.servlet.ServletContext;
  -import javax.xml.parsers.DocumentBuilderFactory;
  -import javax.xml.parsers.DocumentBuilder;
   
  -import org.w3c.dom.Document;
   import org.w3c.dom.Element;
   
   import org.jboss.ejb.DeploymentException;
  @@ -44,7 +41,7 @@
   @see org.jboss.web.AbstractWebContainer
   
   @author [EMAIL PROTECTED]
  -@version $Revision: 1.1.2.1 $
  +@version $Revision: 1.1.2.2 $
   */
   public class EmbeddedTomcatServiceSX extends AbstractWebContainer
       implements EmbeddedTomcatServiceSXMBean
  @@ -75,7 +72,7 @@
           String[] args = {};
           if( configFile != null )
           {
  -            args = new String[]{"", configFile};
  +            args = new String[]{"-config", configFile};
           }
           tomcat = new TomcatEntry(args);
           System.out.println("OK");
  @@ -122,24 +119,15 @@
   
           // Get the servlet class loader
           ClassLoader scl = (ClassLoader) ctx.getServletLoader().getClassLoader();
  -        // Get the web-app.xml and jboss-web.xml deployment descriptors 
  -        File webXml = contextManager.getAbsolute(new File(ctx.getDocBase() + 
"/WEB-INF/web.xml"));
  -        File jbossWebXml = contextManager.getAbsolute(new File(ctx.getDocBase() + 
"/WEB-INF/jboss-web.xml"));
  -        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  -        DocumentBuilder parser = factory.newDocumentBuilder();
  -        Document webDoc = parser.parse(webXml);
  -        Element web = webDoc.getDocumentElement();
  -        Element jbossWeb = null;
  -        if( jbossWebXml.exists() == true )
  -        {
  -            Document jbossWebDoc = parser.parse(jbossWebXml);
  -            jbossWeb = jbossWebDoc.getDocumentElement();
  -        }
  -
  +        /* Get the web-app.xml and jboss-web.xml deployment descriptors elements
  +         that were parsed by the JbossWebXmlReader context interceptor.
  +        */
  +        Element webXml = (Element) ctx.getAttribute("web-app.xml");
  +        Element jbossWebXml = (Element) ctx.getAttribute("jboss-web.xml");
           URL url = new URL(warUrl);
           WebApplication appInfo = new WebApplication(url.getFile(), url, scl);
  -        appInfo.setWebApp(web);
  -        appInfo.setJbossWeb(jbossWeb);
  +        appInfo.setWebApp(webXml);
  +        appInfo.setJbossWeb(jbossWebXml);
           appInfo.setAppData(servletCtx);
           System.out.println("Initialized: "+appInfo); 
           return appInfo;
  @@ -159,3 +147,4 @@
           tomcat.removeContext(servletCtx);
      }
   }
  +
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to