Commits

jcarreira  committed 83b45b6

XW-195: making component manager keys static constants

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@487573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 2b48762

Comments (0)

Files changed (7)

File lib/core/xwork-1.0.1.jar

Binary file added.

File src/java/com/opensymphony/webwork/WebWorkStatics.java

     public static final String SERVLET_CONFIG = "com.opensymphony.xwork.dispatcher.ServletConfig";
 
     /**
-     * Constant for the XWork compontent interceptor.
-     */
-    public static final String COMPONENT_MANAGER = "com.opensymphony.xwork.interceptor.component.ComponentManager";
-
-    /**
      * Constant for the JSP {@link javax.servlet.jsp.PageContext page context}.
      */
     public static final String PAGE_CONTEXT = "com.opensymphony.xwork.dispatcher.PageContext";

File src/java/com/opensymphony/webwork/dispatcher/FilterDispatcher.java

 import com.opensymphony.xwork.config.ConfigurationManager;
 import com.opensymphony.xwork.config.entities.ActionConfig;
 import com.opensymphony.xwork.config.entities.ResultConfig;
+import com.opensymphony.xwork.interceptor.component.ComponentInterceptor;
+import com.opensymphony.xwork.interceptor.component.ComponentManager;
 import com.opensymphony.xwork.util.LocalizedTextUtil;
 
 import org.apache.commons.logging.Log;
                 extraContext.put(HTTP_RESPONSE, response);
                 extraContext.put(ActionContext.SESSION, new SessionMap(request));
                 extraContext.put(ActionContext.APPLICATION, new ApplicationMap(filterConfig.getServletContext()));
-                extraContext.put(COMPONENT_MANAGER, request.getAttribute("DefaultComponentManager"));
+                extraContext.put(ComponentInterceptor.COMPONENT_MANAGER, request.getAttribute(ComponentManager.COMPONENT_MANAGER_KEY));
 
                 try {
                     ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy(namespace, actionName, extraContext);

File src/java/com/opensymphony/webwork/dispatcher/ServletDispatcher.java

 import com.opensymphony.xwork.ActionProxy;
 import com.opensymphony.xwork.ActionProxyFactory;
 import com.opensymphony.xwork.config.ConfigurationException;
+import com.opensymphony.xwork.interceptor.component.ComponentInterceptor;
+import com.opensymphony.xwork.interceptor.component.ComponentManager;
 import com.opensymphony.xwork.util.LocalizedTextUtil;
 
 import org.apache.commons.logging.Log;
         extraContext.put(HTTP_REQUEST, request);
         extraContext.put(HTTP_RESPONSE, response);
         extraContext.put(SERVLET_CONFIG, servletConfig);
-        extraContext.put(COMPONENT_MANAGER, request.getAttribute("DefaultComponentManager"));
+        extraContext.put(ComponentInterceptor.COMPONENT_MANAGER, request.getAttribute(ComponentManager.COMPONENT_MANAGER_KEY));
 
         // helpers to get access to request/session/application scope
         extraContext.put("request", requestMap);

File src/java/com/opensymphony/webwork/lifecycle/ApplicationLifecycleListener.java

      */
     public void contextDestroyed(ServletContextEvent event) {
         ServletContext application = event.getServletContext();
-        ComponentManager container = (ComponentManager) application.getAttribute("DefaultComponentManager");
+        ComponentManager container = (ComponentManager) application.getAttribute(ComponentManager.COMPONENT_MANAGER_KEY);
 
         if (container != null) {
             container.dispose();
 
         config.configure(container, "application");
 
-        application.setAttribute("DefaultComponentManager", container);
+        application.setAttribute(ComponentManager.COMPONENT_MANAGER_KEY, container);
         application.setAttribute("ComponentConfiguration", config);
     }
 

File src/java/com/opensymphony/webwork/lifecycle/RequestLifecycleFilter.java

             }
 
             HttpSession session = ((HttpServletRequest) request).getSession(true);
-            ComponentManager fallback = (ComponentManager) session.getAttribute("DefaultComponentManager");
+            ComponentManager fallback = (ComponentManager) session.getAttribute(ComponentManager.COMPONENT_MANAGER_KEY);
 
             container.setFallback(fallback);
 
 
             config.configure(container, "request");
 
-            request.setAttribute("DefaultComponentManager", container);
+            request.setAttribute(ComponentManager.COMPONENT_MANAGER_KEY, container);
             chain.doFilter(request, response);
         } finally {
             if (log.isDebugEnabled()) {

File src/java/com/opensymphony/webwork/lifecycle/SessionLifecycleListener.java

         HttpSession session = event.getSession();
         ComponentManager container = createComponentManager();
         ServletContext application = getServletContext(session);
-        ComponentManager fallback = (ComponentManager) application.getAttribute("DefaultComponentManager");
+        ComponentManager fallback = (ComponentManager) application.getAttribute(ComponentManager.COMPONENT_MANAGER_KEY);
         container.setFallback(fallback);
 
         ComponentConfiguration config = (ComponentConfiguration) application.getAttribute("ComponentConfiguration");
         config.configure(container, "session");
-        session.setAttribute("DefaultComponentManager", container);
+        session.setAttribute(ComponentManager.COMPONENT_MANAGER_KEY, container);
     }
 
     /**