Author: julien(a)jboss.com
Date: 2008-05-09 09:37:49 -0400 (Fri, 09 May 2008)
New Revision: 10764
Added:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/generic/GenericBootstrapServlet.java
Modified:
modules/web/trunk/web/src/test/resources/spi/generic/app-war/WEB-INF/web.xml
modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/server-war/WEB-INF/web.xml
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml
Log:
renamed PortletContainerBoostrapServlet to GenericBoostrapServlet
Copied:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/generic/GenericBootstrapServlet.java
(from rev 10502,
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/generic/PortletContainerBootstrapServlet.java)
===================================================================
---
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/generic/GenericBootstrapServlet.java
(rev 0)
+++
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/generic/GenericBootstrapServlet.java 2008-05-09
13:37:49 UTC (rev 10764)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.impl.generic;
+
+import org.jboss.portal.web.command.CommandServlet;
+
+import javax.servlet.ServletException;
+import javax.servlet.ServletContext;
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class GenericBootstrapServlet extends CommandServlet
+{
+
+ /** . */
+ private String contextPath;
+
+ public void init() throws ServletException
+ {
+ try
+ {
+ Method m = ServletContext.class.getMethod("getContextPath", new
Class[0]);
+ ServletContext servletContext = getServletContext();
+
+ //
+ String contextPath = (String)m.invoke(servletContext, new Object[0]);
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ GenericWebAppContext webAppContext = new GenericWebAppContext(servletContext,
contextPath, classLoader);
+
+ //
+ GenericServletContainerContext.instance.register(webAppContext);
+ this.contextPath = contextPath;
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void destroy()
+ {
+ if (contextPath != null)
+ {
+ GenericServletContainerContext.instance.unregister(contextPath);
+ }
+ }
+}
Modified: modules/web/trunk/web/src/test/resources/spi/generic/app-war/WEB-INF/web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/spi/generic/app-war/WEB-INF/web.xml 2008-05-09
09:50:03 UTC (rev 10763)
+++
modules/web/trunk/web/src/test/resources/spi/generic/app-war/WEB-INF/web.xml 2008-05-09
13:37:49 UTC (rev 10764)
@@ -28,7 +28,7 @@
<web-app>
<servlet>
<servlet-name>BootstrapServlet</servlet-name>
-
<servlet-class>org.jboss.portal.web.impl.generic.PortletContainerBootstrapServlet</servlet-class>
+
<servlet-class>org.jboss.portal.web.impl.generic.GenericBootstrapServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
Modified:
modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/server-war/WEB-INF/web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/server-war/WEB-INF/web.xml 2008-05-09
09:50:03 UTC (rev 10763)
+++
modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/server-war/WEB-INF/web.xml 2008-05-09
13:37:49 UTC (rev 10764)
@@ -44,7 +44,7 @@
</servlet>
<servlet>
<servlet-name>BootstrapServlet</servlet-name>
-
<servlet-class>org.jboss.portal.web.impl.generic.PortletContainerBootstrapServlet</servlet-class>
+
<servlet-class>org.jboss.portal.web.impl.generic.GenericBootstrapServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
Modified:
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml 2008-05-09
09:50:03 UTC (rev 10763)
+++
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/server-war/WEB-INF/web.xml 2008-05-09
13:37:49 UTC (rev 10764)
@@ -44,7 +44,7 @@
</servlet>
<servlet>
<servlet-name>BootstrapServlet</servlet-name>
-
<servlet-class>org.jboss.portal.web.impl.generic.PortletContainerBootstrapServlet</servlet-class>
+
<servlet-class>org.jboss.portal.web.impl.generic.GenericBootstrapServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>