[jboss-cvs] jboss-portal/server/src/main/org/jboss/portal/server/deployment ...
Julien Viet
julien at jboss.com
Mon Aug 21 19:20:53 EDT 2006
User: julien
Date: 06/08/21 19:20:53
Modified: server/src/main/org/jboss/portal/server/deployment
PortalWebTomcat4App.java PortalWebTomcat5App.java
Log:
remove usage of contextPath information coming from the PortalWebApp and instead use information provided by the servlet container at runtime
Revision Changes Path
1.11 +5 -2 jboss-portal/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat4App.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PortalWebTomcat4App.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat4App.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- PortalWebTomcat4App.java 6 Jan 2006 23:49:05 -0000 1.10
+++ PortalWebTomcat4App.java 21 Aug 2006 23:20:53 -0000 1.11
@@ -33,7 +33,7 @@
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
*/
public class PortalWebTomcat4App extends PortalWebApp
{
@@ -86,9 +86,9 @@
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Class standardContextClass = standardContext.getClass();
-
Class containerBaseClass = standardContextClass.getSuperclass();
Class containerItf = cl.loadClass("org.apache.catalina.Container");
+ Class contextItf = cl.loadClass("org.apache.catalina.Context");
// Inject the command servlet only one time, so we look if it exist already
Method findChildMethod = containerItf.getMethod("findChild", new Class[]{String.class});
@@ -113,6 +113,9 @@
Method addChildMethod = containerBaseClass.getMethod("addChild", new Class[]{containerItf});
addChildMethod.invoke(standardContext, new Object[]{wrapper});
+ Method addServletMapping = contextItf.getMethod("addServletMapping", new Class[]{String.class,String.class});
+ addServletMapping.invoke(standardContext, new Object[]{"/jbossportlet","CommandServlet"});
+
Method loadOnStartupMethod = standardContextClass.getMethod("loadOnStartup", new Class[]{wrapperArray.getClass()});
loadOnStartupMethod.invoke(standardContext, new Object[]{wrapperArray});
}
1.13 +5 -1 jboss-portal/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat5App.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PortalWebTomcat5App.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat5App.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- PortalWebTomcat5App.java 6 Jan 2006 23:49:05 -0000 1.12
+++ PortalWebTomcat5App.java 21 Aug 2006 23:20:53 -0000 1.13
@@ -36,7 +36,7 @@
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.12 $
+ * @version $Revision: 1.13 $
*/
public class PortalWebTomcat5App extends PortalWebApp
{
@@ -194,6 +194,7 @@
Class containerItf = cl.loadClass("org.apache.catalina.Container");
Class standardContextClass = cl.loadClass("org.apache.catalina.core.StandardContext");
Class containerBaseClass = cl.loadClass("org.apache.catalina.core.ContainerBase");
+ Class contextItf = cl.loadClass("org.apache.catalina.Context");
// Ask the context to create a wrapper
Method createWrapperMethod = standardContextClass.getMethod("createWrapper", EMPTY_CLASS_ARRAY);
@@ -214,6 +215,9 @@
Method addChildMethod = containerBaseClass.getMethod("addChild", new Class[]{containerItf});
addChildMethod.invoke(standardContext, new Object[]{wrapper});
+ Method addServletMapping = contextItf.getMethod("addServletMapping", new Class[]{String.class,String.class});
+ addServletMapping.invoke(standardContext, new Object[]{"/jbossportlet","CommandServlet"});
+
Method loadOnStartupMethod = standardContextClass.getMethod("loadOnStartup", new Class[]{wrapperArray.getClass()});
loadOnStartupMethod.invoke(standardContext, new Object[]{wrapperArray});
}
More information about the jboss-cvs-commits
mailing list