From portal-commits at lists.jboss.org Fri May 9 09:37:51 2008 Content-Type: multipart/mixed; boundary="===============5753412889644059520==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r10764 - in modules/web/trunk/web/src: test/resources/spi/generic/app-war/WEB-INF and 2 other directories. Date: Fri, 09 May 2008 09:37:49 -0400 Message-ID: --===============5753412889644059520== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/Ge= nericBootstrapServlet.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/serve= r-war/WEB-INF/web.xml modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/serv= er-war/WEB-INF/web.xml Log: renamed PortletContainerBoostrapServlet to GenericBoostrapServlet Copied: modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/gener= ic/GenericBootstrapServlet.java (from rev 10502, modules/web/trunk/web/src/= main/java/org/jboss/portal/web/impl/generic/PortletContainerBootstrapServle= t.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/generic/G= enericBootstrapServlet.java (rev 0) +++ modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/generic/G= enericBootstrapServlet.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 Julien Viet + * @version $Revision: 1.1 $ + */ +public class GenericBootstrapServlet extends CommandServlet +{ + + /** . */ + private String contextPath; + + public void init() throws ServletException + { + try + { + Method m =3D ServletContext.class.getMethod("getContextPath", new= Class[0]); + ServletContext servletContext =3D getServletContext(); + + // + String contextPath =3D (String)m.invoke(servletContext, new Objec= t[0]); + ClassLoader classLoader =3D Thread.currentThread().getContextClas= sLoader(); + GenericWebAppContext webAppContext =3D new GenericWebAppContext(s= ervletContext, contextPath, classLoader); + + // + GenericServletContainerContext.instance.register(webAppContext); + this.contextPath =3D contextPath; + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + public void destroy() + { + if (contextPath !=3D null) + { + GenericServletContainerContext.instance.unregister(contextPath); + } + } +} Modified: modules/web/trunk/web/src/test/resources/spi/generic/app-war/WEB-= INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/test/resources/spi/generic/app-war/WEB-INF/we= b.xml 2008-05-09 09:50:03 UTC (rev 10763) +++ modules/web/trunk/web/src/test/resources/spi/generic/app-war/WEB-INF/we= b.xml 2008-05-09 13:37:49 UTC (rev 10764) @@ -28,7 +28,7 @@ BootstrapServlet - org.jboss.portal.web.impl.generic.PortletContainerBoo= tstrapServlet + org.jboss.portal.web.impl.generic.GenericBootstrapSer= vlet 0 Modified: modules/web/trunk/web/src/test/resources/support/jboss-4.2-generi= c/server-war/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/test/resources/support/jboss-4.2-generic/serv= er-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/serv= er-war/WEB-INF/web.xml 2008-05-09 13:37:49 UTC (rev 10764) @@ -44,7 +44,7 @@ BootstrapServlet - org.jboss.portal.web.impl.generic.PortletContainerBoo= tstrapServlet + org.jboss.portal.web.impl.generic.GenericBootstrapSer= vlet 0 Modified: modules/web/trunk/web/src/test/resources/support/tomcat-6.0-gener= ic/server-war/WEB-INF/web.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/web/trunk/web/src/test/resources/support/tomcat-6.0-generic/ser= ver-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/ser= ver-war/WEB-INF/web.xml 2008-05-09 13:37:49 UTC (rev 10764) @@ -44,7 +44,7 @@ BootstrapServlet - org.jboss.portal.web.impl.generic.PortletContainerBoo= tstrapServlet + org.jboss.portal.web.impl.generic.GenericBootstrapSer= vlet 0 --===============5753412889644059520==--