geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r676993 - /geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/java/org/apache/geronimo/console/servlet/ContextForwardServlet.java
Date Tue, 15 Jul 2008 18:00:49 GMT
Author: gawor
Date: Tue Jul 15 11:00:48 2008
New Revision: 676993

URL: http://svn.apache.org/viewvc?rev=676993&view=rev
Log:
do not cache ServletContext - based on patch from Manu T George (GERONIMO-4201)

Modified:
    geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/java/org/apache/geronimo/console/servlet/ContextForwardServlet.java

Modified: geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/java/org/apache/geronimo/console/servlet/ContextForwardServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/java/org/apache/geronimo/console/servlet/ContextForwardServlet.java?rev=676993&r1=676992&r2=676993&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/java/org/apache/geronimo/console/servlet/ContextForwardServlet.java
(original)
+++ geronimo/server/branches/2.1/plugins/console/console-portal-driver/src/main/java/org/apache/geronimo/console/servlet/ContextForwardServlet.java
Tue Jul 15 11:00:48 2008
@@ -41,18 +41,17 @@
     // name of the configuration parameter containing the servlet path
     public static final String SERVLET_PATH = "servlet-path";
 
-    private ServletContext forwardContext;
     private String servletPath;
-
+    private String contextPath;
+    
     public void init(ServletConfig config) throws ServletException {
         super.init(config);
-        String contextPath = config.getInitParameter(CONTEXT_PATH);
+        contextPath = config.getInitParameter(CONTEXT_PATH);
         servletPath = config.getInitParameter(SERVLET_PATH);
         if (contextPath == null || servletPath == null) {
             throw new UnavailableException("context-path and servlet-path " +
                     "must be provided as configuration parameters");
         }
-        forwardContext = getServletContext().getContext(contextPath);
     }
 
     public void doGet(HttpServletRequest req, HttpServletResponse resp)
@@ -67,7 +66,8 @@
         if (queryString != null) {
             dispatchURI += "?" + queryString;
         }
-        RequestDispatcher dispatcher = forwardContext.getRequestDispatcher(dispatchURI);
+        ServletContext forwardContext = getServletContext().getContext(contextPath);
+        RequestDispatcher dispatcher = forwardContext.getRequestDispatcher(dispatchURI);
   
         dispatcher.forward(req, resp);
     }
 }



Mime
View raw message