User: starksm
Date: 01/06/09 20:20:54
Modified: tomcat/src/main/org/jboss/tomcat
EmbeddedTomcatServiceSX.java
Log:
Add local entity resolver for web.dtd and jboss-web.dtd
Revision Changes Path
1.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
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EmbeddedTomcatServiceSX.java 2001/05/23 18:26:33 1.1
+++ EmbeddedTomcatServiceSX.java 2001/06/10 03:20:54 1.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;
@@ -47,7 +44,7 @@
@see org.jboss.web.AbstractWebContainer
@author [EMAIL PROTECTED]
-@version $Revision: 1.1 $
+@version $Revision: 1.2 $
*/
public class EmbeddedTomcatServiceSX extends AbstractWebContainer
implements EmbeddedTomcatServiceSXMBean
@@ -84,7 +81,7 @@
String[] args = {};
if( configFile != null )
{
- args = new String[]{"", configFile};
+ args = new String[]{"-config", configFile};
}
tomcat = new TomcatEntry(args);
category.info("OK");
@@ -113,6 +110,7 @@
ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
// Create the container context in tomcat
Context ctx = tomcat.addRawContext(ctxPath, new URL(warUrl));
+ // Add the WebDescriptorParser to the context for access by the
JbossWebXmlReader
ctx.setAttribute("org.jboss.web.AbstractWebContainer.WebDescriptorParser",
webAppParser);
/* Set the parent class loader of the context to the current thread
so that servlet/jsp to ejb calls within this vm bypass serialization
@@ -131,24 +129,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);
category.debug("Initialized: "+appInfo);
return appInfo;
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development