You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mr...@apache.org on 2006/07/04 01:29:22 UTC
svn commit: r418872 - in /struts/struts2/trunk/core/src:
main/java/org/apache/struts2/ main/java/org/apache/struts2/components/
main/java/org/apache/struts2/config/
main/java/org/apache/struts2/config_browser/
main/java/org/apache/struts2/dispatcher/ m...
Author: mrdon
Date: Mon Jul 3 16:29:21 2006
New Revision: 418872
URL: http://svn.apache.org/viewvc?rev=418872&view=rev
Log:
Changed DispatcherUtils from being a singleton to be loaded per
filter/servlet, fixed a few minor renaming things
WW-1369
Added:
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/DispatcherListener.java
Modified:
struts/struts2/trunk/core/src/main/java/org/apache/struts2/StrutsTestCase.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionComponent.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Form.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/URL.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/DefaultConfiguration.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/config_browser/ConfigurationHelper.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ActionContextCleanUp.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/DispatcherUtils.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/FilterDispatcher.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletDispatcher.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/portlet/dispatcher/Jsr168Dispatcher.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/sitegraph/XWorkConfigRetriever.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/spring/lifecycle/SpringExternalReferenceResolverSetupListener.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ResolverSetupServletContextListener.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/validators/DWRValidator.java
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
struts/struts2/trunk/core/src/main/resources/struts.vm
struts/struts2/trunk/core/src/main/xdt/Readme-tagdoclet.txt
struts/struts2/trunk/core/src/main/xdt/taglib_tld.xdt
struts/struts2/trunk/core/src/test/java/org/apache/struts2/components/UIComponentTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/AbstractServletDispatcherTestCase.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherUtilsTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/FilterDispatcherTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptorTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/TokenInterceptorTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/portlet/dispatcher/Jsr168DispatcherTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/PortletUrlTagTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/StrutsTestCase.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/StrutsTestCase.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/StrutsTestCase.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/StrutsTestCase.java Mon Jul 3 16:29:21 2006
@@ -17,8 +17,12 @@
*/
package org.apache.struts2;
+import javax.servlet.ServletContext;
+
import org.apache.struts2.config.Configuration;
import org.apache.struts2.dispatcher.DispatcherUtils;
+import org.springframework.mock.web.MockServletContext;
+
import com.opensymphony.xwork.XWorkTestCase;
import com.opensymphony.xwork.util.LocalizedTextUtil;
@@ -27,11 +31,16 @@
*/
public abstract class StrutsTestCase extends XWorkTestCase {
+
+
protected void setUp() throws Exception {
super.setUp();
- DispatcherUtils.setInstance(null);
Configuration.reset();
LocalizedTextUtil.clearDefaultResourceBundles();
+ DispatcherUtils du = new DispatcherUtils(new MockServletContext());
+ du.setInstance(du);
+ du.setConfigurationManager(configurationManager);
+
}
protected void tearDown() throws Exception {
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionComponent.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionComponent.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionComponent.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ActionComponent.java Mon Jul 3 16:29:21 2006
@@ -24,6 +24,7 @@
import com.opensymphony.xwork.ActionContext;
import com.opensymphony.xwork.ActionProxy;
import com.opensymphony.xwork.ActionProxyFactory;
+import com.opensymphony.xwork.config.Configuration;
import com.opensymphony.xwork.util.OgnlValueStack;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -151,7 +152,6 @@
Map session = ctx.getSession();
Map application = ctx.getApplication();
- DispatcherUtils.initialize(servletContext);
DispatcherUtils du = DispatcherUtils.getInstance();
Map extraContext = du.createContextMap(new RequestMap(req),
newParams,
@@ -216,7 +216,8 @@
OgnlValueStack stack = getStack();
// execute at this point, after params have been set
try {
- proxy = ActionProxyFactory.getFactory().createActionProxy(namespace, actionName, createExtraContext(), executeResult, true);
+ Configuration config = DispatcherUtils.getInstance().getConfigurationManager().getConfiguration();
+ proxy = ActionProxyFactory.getFactory().createActionProxy(config, namespace, actionName, createExtraContext(), executeResult, true);
if (null != methodName) {
proxy.setMethod(methodName);
}
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Form.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Form.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Form.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Form.java Mon Jul 3 16:29:21 2006
@@ -20,7 +20,7 @@
import com.opensymphony.xwork.ActionContext;
import com.opensymphony.xwork.ActionInvocation;
import com.opensymphony.xwork.ObjectFactory;
-import com.opensymphony.xwork.XWorkStatic;
+import com.opensymphony.xwork.config.Configuration;
import com.opensymphony.xwork.config.RuntimeConfiguration;
import com.opensymphony.xwork.config.entities.ActionConfig;
import com.opensymphony.xwork.config.entities.InterceptorMapping;
@@ -136,7 +136,7 @@
action = findString(this.action);
}
- if (DispatcherUtils.isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
+ if (DispatcherUtils.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
evaluateExtraParamsPortletRequest(namespace, action);
} else {
String namespace = determineNamespace(this.namespace, getStack(),
@@ -198,7 +198,8 @@
action = action.substring(0, endIdx);
}
- final ActionConfig actionConfig = XWorkStatic.getConfigurationManager().getConfiguration().getRuntimeConfiguration().getActionConfig(namespace, action);
+ Configuration config = DispatcherUtils.getInstance().getConfigurationManager().getConfiguration();
+ final ActionConfig actionConfig = config.getRuntimeConfiguration().getActionConfig(namespace, action);
String actionName = action;
if (actionConfig != null) {
@@ -270,7 +271,7 @@
addParameter("performValidation", Boolean.FALSE);
- RuntimeConfiguration runtimeConfiguration = XWorkStatic.getConfigurationManager().getConfiguration().getRuntimeConfiguration();
+ RuntimeConfiguration runtimeConfiguration = DispatcherUtils.getInstance().getConfigurationManager().getConfiguration().getRuntimeConfiguration();
ActionConfig actionConfig = runtimeConfiguration.getActionConfig(namespace, actionName);
if (actionConfig != null) {
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/URL.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/URL.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/URL.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/URL.java Mon Jul 3 16:29:21 2006
@@ -176,7 +176,7 @@
}
private void includeGetParameters() {
- if(!(DispatcherUtils.isPortletSupportActive() && PortletActionContext.isPortletRequest())) {
+ if(!(DispatcherUtils.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest())) {
String query = extractQueryString();
if (query != null) {
//mergeRequestParameters(parameters, HttpUtils.parseQueryString(query));
@@ -209,14 +209,14 @@
String result;
if (value == null && action != null) {
- if(DispatcherUtils.isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
+ if(DispatcherUtils.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
result = PortletUrlHelper.buildUrl(action, namespace, parameters, portletUrlType, portletMode, windowState);
}
else {
result = determineActionURL(action, namespace, method, req, res, parameters, scheme, includeContext, encode);
}
} else {
- if(DispatcherUtils.isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
+ if(DispatcherUtils.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
result = PortletUrlHelper.buildResourceUrl(value, parameters);
}
else {
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/DefaultConfiguration.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/DefaultConfiguration.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/DefaultConfiguration.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/DefaultConfiguration.java Mon Jul 3 16:29:21 2006
@@ -92,7 +92,6 @@
while (bundleFiles.hasMoreTokens()) {
String name = bundleFiles.nextToken();
-
try {
log.info("Loading global messages from " + name);
LocalizedTextUtil.addDefaultResourceBundle(name);
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/config_browser/ConfigurationHelper.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/config_browser/ConfigurationHelper.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/config_browser/ConfigurationHelper.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/config_browser/ConfigurationHelper.java Mon Jul 3 16:29:21 2006
@@ -17,13 +17,14 @@
*/
package org.apache.struts2.config_browser;
-import com.opensymphony.xwork.XWorkStatic;
import com.opensymphony.xwork.config.entities.ActionConfig;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
+import org.apache.struts2.dispatcher.DispatcherUtils;
+
/**
* ConfigurationHelper
*/
@@ -31,7 +32,7 @@
public static Set getNamespaces() {
Set namespaces = Collections.EMPTY_SET;
- Map allActionConfigs = XWorkStatic.getConfigurationManager().getConfiguration().getRuntimeConfiguration().getActionConfigs();
+ Map allActionConfigs = DispatcherUtils.getInstance().getConfigurationManager().getConfiguration().getRuntimeConfiguration().getActionConfigs();
if (allActionConfigs != null) {
namespaces = allActionConfigs.keySet();
}
@@ -40,7 +41,7 @@
public static Set getActionNames(String namespace) {
Set actionNames = Collections.EMPTY_SET;
- Map allActionConfigs = XWorkStatic.getConfigurationManager().getConfiguration().getRuntimeConfiguration().getActionConfigs();
+ Map allActionConfigs = DispatcherUtils.getInstance().getConfigurationManager().getConfiguration().getRuntimeConfiguration().getActionConfigs();
if (allActionConfigs != null) {
Map actionMappings = (Map) allActionConfigs.get(namespace);
if (actionMappings != null) {
@@ -52,7 +53,7 @@
public static ActionConfig getActionConfig(String namespace, String actionName) {
ActionConfig config = null;
- Map allActionConfigs = XWorkStatic.getConfigurationManager().getConfiguration().getRuntimeConfiguration().getActionConfigs();
+ Map allActionConfigs = DispatcherUtils.getInstance().getConfigurationManager().getConfiguration().getRuntimeConfiguration().getActionConfigs();
if (allActionConfigs != null) {
Map actionMappings = (Map) allActionConfigs.get(namespace);
if (actionMappings != null) {
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ActionContextCleanUp.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ActionContextCleanUp.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ActionContextCleanUp.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ActionContextCleanUp.java Mon Jul 3 16:29:21 2006
@@ -57,6 +57,7 @@
private static final String COUNTER = "__cleanup_recursion_counter";
protected FilterConfig filterConfig;
+ protected DispatcherUtils dispatcher;
public FilterConfig getFilterConfig() {
return filterConfig;
@@ -64,7 +65,7 @@
public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
- DispatcherUtils.initialize(filterConfig.getServletContext());
+ dispatcher = new DispatcherUtils(filterConfig.getServletContext());
}
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
@@ -74,13 +75,12 @@
// prepare the request no matter what - this ensures that the proper character encoding
// is used before invoking the mapper (see WW-9127)
- DispatcherUtils du = DispatcherUtils.getInstance();
- du.prepare(request, response);
-
+ DispatcherUtils.setInstance(dispatcher);
+ dispatcher.prepare(request, response);
ServletContext servletContext = filterConfig.getServletContext();
try {
- request = du.wrapRequest(request, servletContext);
+ request = dispatcher.wrapRequest(request, servletContext);
} catch (IOException e) {
String message = "Could not wrap servlet request with MultipartRequestWrapper!";
LOG.error(message, e);
@@ -114,6 +114,8 @@
// always dontClean up the thread request, even if an action hasn't been executed
ActionContext.setContext(null);
+
+ DispatcherUtils.setInstance(null);
}
public void destroy() {
Added: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/DispatcherListener.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/DispatcherListener.java?rev=418872&view=auto
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/DispatcherListener.java (added)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/DispatcherListener.java Mon Jul 3 16:29:21 2006
@@ -0,0 +1,29 @@
+/*
+ * $Id: ApplicationMap.java 418521 2006-07-01 23:36:50Z mrdon $
+ *
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.struts2.dispatcher;
+
+/**
+ * A interface to tag those that want to execute code on the init and
+ * destory of a Dispatcher.
+ */
+public interface DispatcherListener {
+
+ public void dispatcherInitialized(DispatcherUtils du);
+
+ public void dispatcherDestroyed(DispatcherUtils du);
+}
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/DispatcherUtils.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/DispatcherUtils.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/DispatcherUtils.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/DispatcherUtils.java Mon Jul 3 16:29:21 2006
@@ -31,6 +31,7 @@
import org.apache.struts2.util.ObjectFactoryInitializable;
import com.opensymphony.xwork.*;
import com.opensymphony.xwork.config.ConfigurationException;
+import com.opensymphony.xwork.config.ConfigurationManager;
import com.opensymphony.xwork.util.*;
import com.opensymphony.xwork.util.location.Location;
import com.opensymphony.xwork.util.location.LocationUtils;
@@ -65,32 +66,35 @@
public class DispatcherUtils {
private static final Log LOG = LogFactory.getLog(DispatcherUtils.class);
- private static DispatcherUtils instance;
+ private static ThreadLocal instance = new ThreadLocal<DispatcherUtils>();
+ private static List<DispatcherListener> dispatcherListeners =
+ new ArrayList<DispatcherListener>();
+ private ConfigurationManager configurationManager;
- private static boolean portletSupportActive;
-
- public static void initialize(ServletContext servletContext) {
- synchronized (DispatcherUtils.class) {
- if (instance == null) {
- instance = new DispatcherUtils(servletContext);
- }
- }
- }
+ private boolean portletSupportActive;
public static DispatcherUtils getInstance() {
- return instance;
+ return (DispatcherUtils) instance.get();
}
public static void setInstance(DispatcherUtils instance) {
- DispatcherUtils.instance = instance;
+ DispatcherUtils.instance.set(instance);
}
-
+
+ public static synchronized void addDispatcherListener(DispatcherListener l) {
+ dispatcherListeners.add(l);
+ }
+
+ public static synchronized void removeDispatcherListener(DispatcherListener l) {
+ dispatcherListeners.remove(l);
+ }
+
protected boolean devMode = false;
// used to get WebLogic to play nice
protected boolean paramsWorkaroundEnabled = false;
- protected DispatcherUtils(ServletContext servletContext) {
+ public DispatcherUtils(ServletContext servletContext) {
init(servletContext);
}
@@ -108,6 +112,14 @@
LOG.error("exception occurred while destroying ObjectFactory ["+objectFactory+"]", e);
}
}
+ instance.set(null);
+ synchronized(DispatcherUtils.class) {
+ if (dispatcherListeners.size() > 0) {
+ for (DispatcherListener l : dispatcherListeners) {
+ l.dispatcherDestroyed(this);
+ }
+ }
+ }
}
protected void init(ServletContext servletContext) {
@@ -129,8 +141,10 @@
try {
Class clazz = ClassLoaderUtil.loadClass(className, DispatcherUtils.class);
ObjectFactory objectFactory = (ObjectFactory) clazz.newInstance();
- if (objectFactory instanceof ObjectFactoryInitializable) {
- ((ObjectFactoryInitializable) objectFactory).init(servletContext);
+ if (servletContext != null) {
+ if (objectFactory instanceof ObjectFactoryInitializable) {
+ ((ObjectFactoryInitializable) objectFactory).init(servletContext);
+ }
}
ObjectFactory.setObjectFactory(objectFactory);
} catch (Exception e) {
@@ -175,7 +189,8 @@
}
// test wether param-access workaround needs to be enabled
- if (servletContext.getServerInfo().indexOf("WebLogic") >= 0) {
+ if (servletContext != null && servletContext.getServerInfo() != null
+ && servletContext.getServerInfo().indexOf("WebLogic") >= 0) {
LOG.info("WebLogic server detected. Enabling Struts parameter access work-around.");
paramsWorkaroundEnabled = true;
} else if (Configuration.isSet(StrutsConstants.STRUTS_DISPATCHER_PARAMETERSWORKAROUND)) {
@@ -196,6 +211,16 @@
LOG.info("Could not load portlet-api, disabling Struts's portlet support.");
}
}
+
+ configurationManager = new ConfigurationManager();
+
+ synchronized(DispatcherUtils.class) {
+ if (dispatcherListeners.size() > 0) {
+ for (DispatcherListener l : dispatcherListeners) {
+ l.dispatcherInitialized(this);
+ }
+ }
+ }
}
/**
@@ -236,7 +261,8 @@
extraContext.put(XWorkContinuationConfig.CONTINUE_KEY, id);
}
- ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy(namespace, name, extraContext, true, false);
+ ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy(
+ configurationManager.getConfiguration(), namespace, name, extraContext, true, false);
proxy.setMethod(method);
request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, proxy.getInvocation().getStack());
@@ -510,7 +536,7 @@
*
* @return <tt>true</tt>, if portlet support is active, <tt>false</tt> otherwise.
*/
- public static boolean isPortletSupportActive() {
+ public boolean isPortletSupportActive() {
return portletSupportActive;
}
@@ -519,5 +545,13 @@
public Location getLocation(Throwable t) {
return LocationUtils.getLocation(t);
}
+ }
+
+ public ConfigurationManager getConfigurationManager() {
+ return configurationManager;
+ }
+
+ public void setConfigurationManager(ConfigurationManager mgr) {
+ this.configurationManager = mgr;
}
}
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/FilterDispatcher.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/FilterDispatcher.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/FilterDispatcher.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/FilterDispatcher.java Mon Jul 3 16:29:21 2006
@@ -106,6 +106,7 @@
protected FilterConfig filterConfig;
protected String[] pathPrefixes;
+ protected DispatcherUtils dispatcher;
private SimpleDateFormat df = new SimpleDateFormat("E, d MMM yyyy HH:mm:ss");
private final Calendar lastModifiedCal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
@@ -116,11 +117,11 @@
}
public void destroy() {
- DispatcherUtils du = DispatcherUtils.getInstance(); // should not be null as it is initialized in init(FilterConfig)
- if (du == null) {
- LOG.warn("something is seriously wrong, DispatcherUtil is not initialized (null) ");
- }
- du.cleanup();
+ if (dispatcher == null) {
+ LOG.warn("something is seriously wrong, DispatcherUtil is not initialized (null) ");
+ } else {
+ dispatcher.cleanup();
+ }
}
public void init(FilterConfig filterConfig) throws ServletException {
@@ -131,7 +132,7 @@
packages = param + " " + packages;
}
this.pathPrefixes = parse(packages);
- DispatcherUtils.initialize(filterConfig.getServletContext());
+ dispatcher = new DispatcherUtils(filterConfig.getServletContext());
}
protected String[] parse(String packages) {
@@ -158,19 +159,26 @@
HttpServletResponse response = (HttpServletResponse) res;
ServletContext servletContext = filterConfig.getServletContext();
- // prepare the request no matter what - this ensures that the proper character encoding
- // is used before invoking the mapper (see WW-9127)
DispatcherUtils du = DispatcherUtils.getInstance();
- try {
- // Wrap request first, just in case it is multipart/form-data
- // parameters might not be accessible through before encoding (ww-1278)
- request = du.wrapRequest(request, servletContext);
- } catch (IOException e) {
- String message = "Could not wrap servlet request with MultipartRequestWrapper!";
- LOG.error(message, e);
- throw new ServletException(message, e);
+
+ // Prepare and wrap the request if the cleanup filter hasn't already
+ if (du == null) {
+ du = dispatcher;
+ // prepare the request no matter what - this ensures that the proper character encoding
+ // is used before invoking the mapper (see WW-9127)
+ du.prepare(request, response);
+
+ try {
+ // Wrap request first, just in case it is multipart/form-data
+ // parameters might not be accessible through before encoding (ww-1278)
+ request = du.wrapRequest(request, servletContext);
+ } catch (IOException e) {
+ String message = "Could not wrap servlet request with MultipartRequestWrapper!";
+ LOG.error(message, e);
+ throw new ServletException(message, e);
+ }
+ DispatcherUtils.setInstance(du);
}
- du.prepare(request, response);
ActionMapper mapper = ActionMapperFactory.getMapper();
ActionMapping mapping = mapper.getMapping(request);
@@ -201,7 +209,7 @@
o = beforeActionInvocation(request, servletContext);
- du.serviceAction(request, response, servletContext, mapping);
+ dispatcher.serviceAction(request, response, servletContext, mapping);
} finally {
afterActionInvocation(request, servletContext, o);
ActionContextCleanUp.cleanUp(req);
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletDispatcher.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletDispatcher.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletDispatcher.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletDispatcher.java Mon Jul 3 16:29:21 2006
@@ -29,6 +29,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
/**
* Main dispatcher servlet in Struts which acts as the controller in the MVC paradigm. <p>
@@ -69,6 +71,10 @@
* Logger for this class.
*/
protected static final Log LOG = LogFactory.getLog(ServletDispatcher.class);
+
+ protected static Map<String,DispatcherUtils> dispatchers = new HashMap<String,DispatcherUtils>();
+
+ protected DispatcherUtils dispatcher;
/**
* Initalizes the servlet. Please read the {@link ServletDispatcher class documentation} for more
@@ -79,7 +85,29 @@
*/
public void init(ServletConfig servletConfig) throws ServletException {
super.init(servletConfig);
- DispatcherUtils.initialize(getServletContext());
+ synchronized(dispatchers) {
+ dispatcher = dispatchers.get(servletConfig.getServletName());
+ if (dispatcher == null) {
+ dispatcher = new DispatcherUtils(getServletContext());
+ dispatchers.put(servletConfig.getServletName(), dispatcher);
+ }
+ }
+ }
+
+ /**
+ * Cleans up the dispatcher
+ */
+ @Override
+ public void destroy() {
+ super.destroy();
+ synchronized(dispatchers) {
+ String key = getServletConfig().getServletName();
+ if (dispatchers.containsKey(key)) {
+ dispatcher.cleanup();
+ dispatchers.remove(key);
+ dispatcher = null;
+ }
+ }
}
/**
@@ -95,8 +123,8 @@
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException {
// prepare the request no matter what - this ensures that the proper character encoding
// is used before invoking the mapper (see WW-9127)
- DispatcherUtils du = DispatcherUtils.getInstance();
- du.prepare(request, response);
+ DispatcherUtils.setInstance(dispatcher);
+ dispatcher.prepare(request, response);
ActionMapping mapping = ActionMapperFactory.getMapper().getMapping(request);
if (mapping == null) {
@@ -109,13 +137,13 @@
}
try {
- request = du.wrapRequest(request, getServletContext());
+ request = dispatcher.wrapRequest(request, getServletContext());
} catch (IOException e) {
String message = "Could not wrap servlet request with MultipartRequestWrapper!";
LOG.error(message, e);
throw new ServletException(message, e);
}
- du.serviceAction(request, response, getServletContext(), mapping);
+ dispatcher.serviceAction(request, response, getServletContext(), mapping);
}
}
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/portlet/dispatcher/Jsr168Dispatcher.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/portlet/dispatcher/Jsr168Dispatcher.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/portlet/dispatcher/Jsr168Dispatcher.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/portlet/dispatcher/Jsr168Dispatcher.java Mon Jul 3 16:29:21 2006
@@ -40,6 +40,7 @@
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.dispatcher.ApplicationMap;
+import org.apache.struts2.dispatcher.DispatcherUtils;
import org.apache.struts2.dispatcher.RequestMap;
import org.apache.struts2.dispatcher.SessionMap;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
@@ -59,6 +60,7 @@
import com.opensymphony.xwork.ActionProxyFactory;
import com.opensymphony.xwork.ObjectFactory;
import com.opensymphony.xwork.config.ConfigurationException;
+import com.opensymphony.xwork.config.ConfigurationManager;
import com.opensymphony.xwork.util.LocalizedTextUtil;
import com.opensymphony.xwork.util.OgnlValueStack;
@@ -164,13 +166,15 @@
private Map actionMap = new HashMap(3);
private String portletNamespace = null;
+
+ private DispatcherUtils dispatcherUtils;
/**
* Initialize the portlet with the init parameters from <tt>portlet.xml</tt>
*/
public void init(PortletConfig cfg) throws PortletException {
super.init(cfg);
- LOG.debug("Initializin portlet " + getPortletName());
+ LOG.debug("Initializing portlet " + getPortletName());
// For testability
if (factory == null) {
factory = ActionProxyFactory.getFactory();
@@ -234,6 +238,8 @@
+ ". Using default ObjectFactory.", e);
}
}
+
+ dispatcherUtils = new DispatcherUtils(null);
}
/**
@@ -281,6 +287,7 @@
public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException {
LOG.debug("Entering processAction");
+ DispatcherUtils.setInstance(dispatcherUtils);
resetActionContext();
try {
serviceAction(request, response, getActionMapping(request),
@@ -410,7 +417,8 @@
try {
LOG.debug("Creating action proxy for name = " + actionName
+ ", namespace = " + namespace);
- ActionProxy proxy = factory.createActionProxy(namespace,
+ ActionProxy proxy = factory.createActionProxy(
+ dispatcherUtils.getConfigurationManager().getConfiguration(), namespace,
actionName, extraContext);
request.setAttribute("struts.valueStack", proxy.getInvocation()
.getStack());
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/sitegraph/XWorkConfigRetriever.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/sitegraph/XWorkConfigRetriever.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/sitegraph/XWorkConfigRetriever.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/sitegraph/XWorkConfigRetriever.java Mon Jul 3 16:29:21 2006
@@ -3,12 +3,12 @@
*/
package org.apache.struts2.sitegraph;
-import com.opensymphony.xwork.XWorkStatic;
import com.opensymphony.xwork.config.ConfigurationProvider;
import com.opensymphony.xwork.config.entities.ActionConfig;
import com.opensymphony.xwork.config.entities.ResultConfig;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.dispatcher.DispatcherUtils;
import org.apache.struts2.sitegraph.collectors.ArbitraryXMLConfigurationProvider;
import org.apache.struts2.sitegraph.entities.FreeMarkerView;
import org.apache.struts2.sitegraph.entities.JspView;
@@ -41,7 +41,7 @@
public static Map getActionConfigs() {
if (!isXWorkStarted)
initXWork();
- return XWorkStatic.getConfigurationManager().getConfiguration().getRuntimeConfiguration().getActionConfigs();
+ return DispatcherUtils.getInstance().getConfigurationManager().getConfiguration().getRuntimeConfiguration().getActionConfigs();
}
private static void initXWork() {
@@ -49,7 +49,7 @@
File configFile = new File(configFilePath);
try {
ConfigurationProvider configProvider = new ArbitraryXMLConfigurationProvider(configFile.getCanonicalPath());
- XWorkStatic.getConfigurationManager().addConfigurationProvider(configProvider);
+ DispatcherUtils.getInstance().getConfigurationManager().addConfigurationProvider(configProvider);
isXWorkStarted = true;
} catch (IOException e) {
LOG.error("IOException", e);
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/spring/lifecycle/SpringExternalReferenceResolverSetupListener.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/spring/lifecycle/SpringExternalReferenceResolverSetupListener.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/spring/lifecycle/SpringExternalReferenceResolverSetupListener.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/spring/lifecycle/SpringExternalReferenceResolverSetupListener.java Mon Jul 3 16:29:21 2006
@@ -17,16 +17,22 @@
*/
package org.apache.struts2.spring.lifecycle;
-import com.opensymphony.xwork.XWorkStatic;
import com.opensymphony.xwork.config.Configuration;
import com.opensymphony.xwork.config.ExternalReferenceResolver;
import com.opensymphony.xwork.config.entities.PackageConfig;
+
+import org.apache.struts2.dispatcher.DispatcherListener;
+import org.apache.struts2.dispatcher.DispatcherUtils;
+import org.apache.struts2.util.ServletContextAware;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.web.context.support.WebApplicationContextUtils;
+import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
+
+import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -39,26 +45,49 @@
*/
public class SpringExternalReferenceResolverSetupListener implements
ServletContextListener {
- public void contextInitialized(ServletContextEvent event) {
- ApplicationContext appContext = WebApplicationContextUtils
- .getWebApplicationContext(event.getServletContext());
-
- Configuration xworkConfig = XWorkStatic.getConfigurationManager().getConfiguration();
- Map packageConfigs = xworkConfig.getPackageConfigs();
- Iterator i = packageConfigs.values().iterator();
-
- while (i.hasNext()) {
- PackageConfig packageConfig = (PackageConfig) i.next();
- ExternalReferenceResolver resolver = packageConfig.getExternalRefResolver();
- if (resolver == null || !(resolver instanceof ApplicationContextAware))
- continue;
- ApplicationContextAware contextAware = (ApplicationContextAware) resolver;
- contextAware.setApplicationContext(appContext);
- }
+
+ private Map<ServletContext,Listener> listeners = new HashMap<ServletContext,Listener>();
+
+ public synchronized void contextDestroyed(ServletContextEvent event) {
+ Listener l = listeners.get(event.getServletContext());
+ DispatcherUtils.removeDispatcherListener(l);
+ listeners.remove(event.getServletContext());
}
- public void contextDestroyed(ServletContextEvent event) {
- // Nothing to do
+ public synchronized void contextInitialized(ServletContextEvent event) {
+ Listener l = new Listener(event.getServletContext());
+ DispatcherUtils.addDispatcherListener(l);
+ listeners.put(event.getServletContext(), l);
}
+
+ private class Listener implements DispatcherListener {
+
+ private ServletContext servletContext;
+
+ public Listener(ServletContext ctx) {
+ this.servletContext = ctx;
+ }
+
+ public void dispatcherInitialized(DispatcherUtils du) {
+ ApplicationContext appContext = WebApplicationContextUtils
+ .getWebApplicationContext(servletContext);
+
+ Configuration xworkConfig = du.getConfigurationManager().getConfiguration();
+ Map packageConfigs = xworkConfig.getPackageConfigs();
+ Iterator i = packageConfigs.values().iterator();
+
+ while (i.hasNext()) {
+ PackageConfig packageConfig = (PackageConfig) i.next();
+ ExternalReferenceResolver resolver = packageConfig.getExternalRefResolver();
+ if (resolver == null || !(resolver instanceof ApplicationContextAware))
+ continue;
+ ApplicationContextAware contextAware = (ApplicationContextAware) resolver;
+ contextAware.setApplicationContext(appContext);
+ }
+
+ }
+ public void dispatcherDestroyed(DispatcherUtils du) {
+ }
+ }
}
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ResolverSetupServletContextListener.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ResolverSetupServletContextListener.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ResolverSetupServletContextListener.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/ResolverSetupServletContextListener.java Mon Jul 3 16:29:21 2006
@@ -17,13 +17,19 @@
*/
package org.apache.struts2.util;
-import com.opensymphony.xwork.XWorkStatic;
import com.opensymphony.xwork.config.Configuration;
import com.opensymphony.xwork.config.entities.PackageConfig;
+import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
+
+import org.apache.struts2.dispatcher.DispatcherUtils;
+import org.apache.struts2.dispatcher.DispatcherListener;
+
+import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
/**
@@ -36,22 +42,46 @@
*/
public class ResolverSetupServletContextListener implements ServletContextListener {
- public void contextDestroyed(ServletContextEvent event) {
+ Map<ServletContext,Listener> listeners = new HashMap<ServletContext,Listener>();
+
+ public synchronized void contextDestroyed(ServletContextEvent event) {
+ Listener l = listeners.get(event.getServletContext());
+ DispatcherUtils.removeDispatcherListener(l);
+ listeners.remove(event.getServletContext());
}
- public void contextInitialized(ServletContextEvent event) {
- Configuration config = XWorkStatic.getConfigurationManager().getConfiguration();
- String key;
- PackageConfig packageConfig;
-
- for (Iterator iter = config.getPackageConfigNames().iterator();
- iter.hasNext();) {
- key = (String) iter.next();
- packageConfig = config.getPackageConfig(key);
+ public synchronized void contextInitialized(ServletContextEvent event) {
+ Listener l = new Listener(event.getServletContext());
+ DispatcherUtils.addDispatcherListener(l);
+ listeners.put(event.getServletContext(), l);
+ }
+
+ private class Listener implements DispatcherListener {
- if (packageConfig.getExternalRefResolver()instanceof ServletContextAware) {
- ((ServletContextAware) packageConfig.getExternalRefResolver()).setServletContext(event.getServletContext());
+ private ServletContext servletContext;
+
+ public Listener(ServletContext ctx) {
+ this.servletContext = ctx;
+ }
+
+ public void dispatcherInitialized(DispatcherUtils du) {
+ Configuration config = du.getConfigurationManager().getConfiguration();
+ String key;
+ PackageConfig packageConfig;
+
+ for (Iterator iter = config.getPackageConfigNames().iterator();
+ iter.hasNext();) {
+ key = (String) iter.next();
+ packageConfig = config.getPackageConfig(key);
+
+ if (packageConfig.getExternalRefResolver()instanceof ServletContextAware) {
+ ((ServletContextAware) packageConfig.getExternalRefResolver()).setServletContext(servletContext);
+ }
}
+
+ }
+
+ public void dispatcherDestroyed(DispatcherUtils du) {
}
}
}
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/validators/DWRValidator.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/validators/DWRValidator.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/validators/DWRValidator.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/validators/DWRValidator.java Mon Jul 3 16:29:21 2006
@@ -22,6 +22,8 @@
import org.apache.struts2.dispatcher.RequestMap;
import org.apache.struts2.dispatcher.SessionMap;
import com.opensymphony.xwork.*;
+import com.opensymphony.xwork.config.Configuration;
+import com.opensymphony.xwork.config.ConfigurationManager;
import com.opensymphony.xwork.config.entities.ActionConfig;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -77,7 +79,8 @@
servletContext);
try {
- ValidatorActionProxy proxy = new ValidatorActionProxy(namespace, action, ctx);
+ Configuration cfg = du.getConfigurationManager().getConfiguration();
+ ValidatorActionProxy proxy = new ValidatorActionProxy(cfg, namespace, action, ctx);
proxy.execute();
Object a = proxy.getAction();
@@ -109,8 +112,8 @@
}
public static class ValidatorActionProxy extends DefaultActionProxy {
- protected ValidatorActionProxy(String namespace, String actionName, Map extraContext) throws Exception {
- super(namespace, actionName, extraContext, false, true);
+ protected ValidatorActionProxy(Configuration config, String namespace, String actionName, Map extraContext) throws Exception {
+ super(config, namespace, actionName, extraContext, false, true);
}
protected void prepare() throws Exception {
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java Mon Jul 3 16:29:21 2006
@@ -49,7 +49,6 @@
stack = new OgnlValueStack();
HttpServletResponse res = (HttpServletResponse) pageContext.getResponse();
- DispatcherUtils.initialize(pageContext.getServletContext());
DispatcherUtils du = DispatcherUtils.getInstance();
Map extraContext = du.createContextMap(new RequestMap(req),
req.getParameterMap(),
Modified: struts/struts2/trunk/core/src/main/resources/struts.vm
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/struts.vm?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/struts.vm (original)
+++ struts/struts2/trunk/core/src/main/resources/struts.vm Mon Jul 3 16:29:21 2006
@@ -7,7 +7,7 @@
#end
#macro(url $name)
- #set ($name = $struts.bean("org.apache.struts.action2.util.URLBean"))
+ #set ($name = $struts.bean("org.apache.struts2.util.URLBean"))
$name.setRequest($req)
$name.setResponse($res)
#end
Modified: struts/struts2/trunk/core/src/main/xdt/Readme-tagdoclet.txt
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/xdt/Readme-tagdoclet.txt?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/xdt/Readme-tagdoclet.txt (original)
+++ struts/struts2/trunk/core/src/main/xdt/Readme-tagdoclet.txt Mon Jul 3 16:29:21 2006
@@ -3,7 +3,7 @@
The provided xdoclet templates are based on original xdoclet distribution templates for tld generation.
-The annotations may be used for classes extending TagSupport or oas.action2.components.Component. If used in component
+The annotations may be used for classes extending TagSupport or oa.struts2.components.Component. If used in component
classes, you will also need a TagSupport wrapper class to generate valid tld (see @a2:tag#tld-tag-class).
Following a description of the provided tags and their parameters:
Modified: struts/struts2/trunk/core/src/main/xdt/taglib_tld.xdt
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/xdt/taglib_tld.xdt?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/xdt/taglib_tld.xdt (original)
+++ struts/struts2/trunk/core/src/main/xdt/taglib_tld.xdt Mon Jul 3 16:29:21 2006
@@ -74,7 +74,7 @@
</XDtMerge:merge>
</XDtConfig:ifConfigParamGreaterOrEquals>
- <XDtClass:forAllClasses type="javax.servlet.jsp.tagext.Tag,javax.servlet.jsp.tagext.TagSupport,javax.servlet.jsp.tagext.SimpleTagSupport,org.apache.struts.action2.components.Component" abstract="false">
+ <XDtClass:forAllClasses type="javax.servlet.jsp.tagext.Tag,javax.servlet.jsp.tagext.TagSupport,javax.servlet.jsp.tagext.SimpleTagSupport,org.apache.struts2.components.Component" abstract="false">
<XDtClass:ifHasClassTag tagName="a2:tag">
<tag>
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/components/UIComponentTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/components/UIComponentTest.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/components/UIComponentTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/components/UIComponentTest.java Mon Jul 3 16:29:21 2006
@@ -18,7 +18,6 @@
package org.apache.struts2.components;
import com.opensymphony.xwork.ActionContext;
-import com.opensymphony.xwork.XWorkStatic;
import org.apache.struts2.TestConfigurationProvider;
import org.apache.struts2.views.jsp.AbstractUITagTest;
import org.apache.struts2.views.jsp.ui.*;
@@ -246,8 +245,8 @@
// form
public void testFormComponentDisposeItselfFromComponentStack() throws Exception {
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().addConfigurationProvider(new TestConfigurationProvider());
+ configurationManager.clearConfigurationProviders();
+ configurationManager.addConfigurationProvider(new TestConfigurationProvider());
ActionContext.getContext().setValueStack(stack);
request.setupGetServletPath("/testAction");
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/AbstractServletDispatcherTestCase.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/AbstractServletDispatcherTestCase.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/AbstractServletDispatcherTestCase.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/AbstractServletDispatcherTestCase.java Mon Jul 3 16:29:21 2006
@@ -23,7 +23,6 @@
import com.mockobjects.servlet.MockHttpSession;
import com.mockobjects.servlet.MockServletConfig;
import com.mockobjects.servlet.MockServletOutputStream;
-import com.opensymphony.xwork.XWorkStatic;
import com.opensymphony.xwork.config.providers.XmlConfigurationProvider;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.views.jsp.StrutsMockHttpServletRequest;
@@ -66,14 +65,14 @@
protected void loadConfig() {
XmlConfigurationProvider c = new XmlConfigurationProvider(getConfigFilename());
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().destroyConfiguration();
- XWorkStatic.getConfigurationManager().addConfigurationProvider(c);
- XWorkStatic.getConfigurationManager().getConfiguration();
+ configurationManager.clearConfigurationProviders();
+ configurationManager.destroyConfiguration();
+ configurationManager.addConfigurationProvider(c);
+ configurationManager.getConfiguration();
}
protected void tearDown() throws Exception {
- XWorkStatic.getConfigurationManager().destroyConfiguration();
+ configurationManager.destroyConfiguration();
}
private void service(HttpServlet servlet) throws ServletException, IOException {
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherUtilsTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherUtilsTest.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherUtilsTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/DispatcherUtilsTest.java Mon Jul 3 16:29:21 2006
@@ -19,13 +19,10 @@
import java.util.Locale;
-import org.springframework.mock.web.MockServletContext;
import org.apache.struts2.StrutsTestCase;
import com.opensymphony.xwork.util.LocalizedTextUtil;
-import junit.framework.TestCase;
-
/**
* Test case for DispatcherUtils.
*
@@ -34,7 +31,6 @@
public void testDefaultResurceBundlePropertyLoaded() throws Exception {
Locale.setDefault(Locale.US); // force to US locale as we also have _de and _da properties
- DispatcherUtils.initialize(new MockServletContext());
// some i18n messages from xwork-messages.properties
assertEquals(
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/FilterDispatcherTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/FilterDispatcherTest.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/FilterDispatcherTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/FilterDispatcherTest.java Mon Jul 3 16:29:21 2006
@@ -64,12 +64,9 @@
}
public void testObjectFactoryDestroy() throws Exception {
- Configuration.reset();
- DispatcherUtils.setInstance(null);
-
- DispatcherUtils.initialize(new MockServletContext());
FilterDispatcher filterDispatcher = new FilterDispatcher();
+ filterDispatcher.init(new MockFilterConfig(null));
InnerDestroyableObjectFactory destroyedObjectFactory = new InnerDestroyableObjectFactory();
ObjectFactory.setObjectFactory(destroyedObjectFactory);
@@ -80,8 +77,6 @@
public void testObjectFactoryInitializable() throws Exception {
- Configuration.reset();
- DispatcherUtils.setInstance(null);
Map configMap = new HashMap();
configMap.put(StrutsConstants.STRUTS_OBJECTFACTORY, "org.apache.struts2.dispatcher.FilterDispatcherTest$InnerInitializableObjectFactory");
@@ -100,8 +95,6 @@
}
public void testObjectFactoryLifecycle() throws Exception {
- Configuration.reset();
- DispatcherUtils.setInstance(null);
Map configMap = new HashMap();
configMap.put(StrutsConstants.STRUTS_OBJECTFACTORY, "org.apache.struts2.dispatcher.FilterDispatcherTest$InnerInitailizableDestroyableObjectFactory");
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptorTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptorTest.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptorTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptorTest.java Mon Jul 3 16:29:21 2006
@@ -156,13 +156,14 @@
}
protected ActionProxy buildProxy(String actionName) throws Exception {
- return ActionProxyFactory.getFactory().createActionProxy("", actionName, context);
+ return ActionProxyFactory.getFactory().createActionProxy(
+ configurationManager.getConfiguration(), "", actionName, context);
}
protected void setUp() throws Exception {
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().addConfigurationProvider(new WaitConfigurationProvider());
- XWorkStatic.getConfigurationManager().getConfiguration().reload();
+ configurationManager.clearConfigurationProviders();
+ configurationManager.addConfigurationProvider(new WaitConfigurationProvider());
+ configurationManager.reload();
session = new HashMap();
params = new HashMap();
@@ -178,8 +179,8 @@
}
protected void tearDown() throws Exception {
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().destroyConfiguration();
+ configurationManager.clearConfigurationProviders();
+ configurationManager.destroyConfiguration();
ActionContext.setContext(null);
}
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/TokenInterceptorTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/TokenInterceptorTest.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/TokenInterceptorTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/TokenInterceptorTest.java Mon Jul 3 16:29:21 2006
@@ -97,9 +97,9 @@
}
protected void setUp() throws Exception {
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().addConfigurationProvider(new TestConfigurationProvider());
- XWorkStatic.getConfigurationManager().getConfiguration().reload();
+ configurationManager.clearConfigurationProviders();
+ configurationManager.addConfigurationProvider(new TestConfigurationProvider());
+ configurationManager.reload();
session = new HashMap();
params = new HashMap();
@@ -120,11 +120,12 @@
}
protected ActionProxy buildProxy(String actionName) throws Exception {
- return ActionProxyFactory.getFactory().createActionProxy("", actionName, extraContext, true, true);
+ return ActionProxyFactory.getFactory().createActionProxy(
+ configurationManager.getConfiguration(), "", actionName, extraContext, true, true);
}
protected void tearDown() throws Exception {
- XWorkStatic.getConfigurationManager().destroyConfiguration();
+ configurationManager.destroyConfiguration();
ActionContext.setContext(null);
}
}
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/portlet/dispatcher/Jsr168DispatcherTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/portlet/dispatcher/Jsr168DispatcherTest.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/portlet/dispatcher/Jsr168DispatcherTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/portlet/dispatcher/Jsr168DispatcherTest.java Mon Jul 3 16:29:21 2006
@@ -42,12 +42,15 @@
import org.jmock.cglib.MockObjectTestCase;
import org.jmock.core.Constraint;
+import org.apache.struts2.dispatcher.DispatcherUtils;
import org.apache.struts2.portlet.PortletActionConstants;
import org.apache.struts2.portlet.context.ServletContextHolderListener;
import com.opensymphony.xwork.Action;
import com.opensymphony.xwork.ActionInvocation;
import com.opensymphony.xwork.ActionProxy;
import com.opensymphony.xwork.ActionProxyFactory;
+import com.opensymphony.xwork.config.Configuration;
+import com.opensymphony.xwork.config.ConfigurationManager;
import com.opensymphony.xwork.util.OgnlValueStack;
/**
@@ -71,17 +74,17 @@
}
private void initPortletConfig(final Map initParams, final Map attributes) {
- mockConfig = mock(PortletConfig.class);
- mockCtx = mock(PortletContext.class);
- mockConfig.stubs().method(ANYTHING);
- setupStub(initParams, mockConfig, "getInitParameter");
- mockCtx.stubs().method("getAttributeNames").will(returnValue(Collections.enumeration(attributes.keySet())));
- setupStub(attributes, mockCtx, "getAttribute");
- mockConfig.stubs().method("getPortletContext").will(returnValue(mockCtx.proxy()));
- mockCtx.stubs().method("getInitParameterNames").will(returnValue(Collections.enumeration(initParams.keySet())));
- setupStub(initParams, mockCtx, "getInitParameter");
-
- mockConfig.stubs().method("getResourceBundle").will(returnValue(new ListResourceBundle() {
+ mockConfig = mock(PortletConfig.class);
+ mockCtx = mock(PortletContext.class);
+ mockConfig.stubs().method(ANYTHING);
+ setupStub(initParams, mockConfig, "getInitParameter");
+ mockCtx.stubs().method("getAttributeNames").will(returnValue(Collections.enumeration(attributes.keySet())));
+ setupStub(attributes, mockCtx, "getAttribute");
+ mockConfig.stubs().method("getPortletContext").will(returnValue(mockCtx.proxy()));
+ mockCtx.stubs().method("getInitParameterNames").will(returnValue(Collections.enumeration(initParams.keySet())));
+ setupStub(initParams, mockCtx, "getInitParameter");
+
+ mockConfig.stubs().method("getResourceBundle").will(returnValue(new ListResourceBundle() {
protected Object[][] getContents() {
return new String[][]{{"javax.portlet.title", "MyTitle"}};
}
@@ -89,18 +92,18 @@
}
private void setupActionFactory(String namespace, String actionName, String result, OgnlValueStack stack) {
- if(mockActionFactory == null) {
- mockActionFactory = mock(ActionProxyFactory.class);
- }
- mockAction = mock(Action.class);
- mockActionProxy = mock(ActionProxy.class);
- mockInvocation = mock(ActionInvocation.class);
-
- mockActionFactory.expects(once()).method("createActionProxy").with(new Constraint[]{eq(namespace), eq(actionName), isA(Map.class)}).will(returnValue(mockActionProxy.proxy()));
- mockActionProxy.stubs().method("getAction").will(returnValue(mockAction.proxy()));
- mockActionProxy.expects(once()).method("execute").will(returnValue(result));
- mockActionProxy.expects(once()).method("getInvocation").will(returnValue(mockInvocation.proxy()));
- mockInvocation.stubs().method("getStack").will(returnValue(stack));
+ if(mockActionFactory == null) {
+ mockActionFactory = mock(ActionProxyFactory.class);
+ }
+ mockAction = mock(Action.class);
+ mockActionProxy = mock(ActionProxy.class);
+ mockInvocation = mock(ActionInvocation.class);
+
+ mockActionFactory.expects(once()).method("createActionProxy").with(new Constraint[]{isA(Configuration.class), eq(namespace), eq(actionName), isA(Map.class)}).will(returnValue(mockActionProxy.proxy()));
+ mockActionProxy.stubs().method("getAction").will(returnValue(mockAction.proxy()));
+ mockActionProxy.expects(once()).method("execute").will(returnValue(result));
+ mockActionProxy.expects(once()).method("getInvocation").will(returnValue(mockInvocation.proxy()));
+ mockInvocation.stubs().method("getStack").will(returnValue(stack));
}
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java Mon Jul 3 16:29:21 2006
@@ -96,8 +96,9 @@
pageContext.setJspWriter(jspWriter);
pageContext.setServletContext(servletContext);
- DispatcherUtils.initialize(pageContext.getServletContext());
- DispatcherUtils du = DispatcherUtils.getInstance();
+ DispatcherUtils du = new DispatcherUtils(pageContext.getServletContext());
+ du.setInstance(du);
+ du.setConfigurationManager(configurationManager);
session = new SessionMap(request);
Map extraContext = du.createContextMap(new RequestMap(request),
request.getParameterMap(),
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java Mon Jul 3 16:29:21 2006
@@ -231,9 +231,9 @@
protected void setUp() throws Exception {
super.setUp();
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().addConfigurationProvider(new TestConfigurationProvider());
- XWorkStatic.getConfigurationManager().getConfiguration().reload();
+ configurationManager.clearConfigurationProviders();
+ configurationManager.addConfigurationProvider(new TestConfigurationProvider());
+ configurationManager.reload();
ActionContext actionContext = new ActionContext(context);
actionContext.setValueStack(stack);
@@ -241,7 +241,7 @@
}
protected void tearDown() throws Exception {
- XWorkStatic.getConfigurationManager().destroyConfiguration();
+ configurationManager.destroyConfiguration();
OgnlValueStack stack = new OgnlValueStack();
ActionContext.setContext(new ActionContext(stack.getContext()));
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/PortletUrlTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/PortletUrlTagTest.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/PortletUrlTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/PortletUrlTagTest.java Mon Jul 3 16:29:21 2006
@@ -81,6 +81,7 @@
super.setUp();
Configuration.reset();
+ DispatcherUtils.setInstance(new DispatcherUtils(null));
mockPortletApiAvailable();
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/FormTagTest.java Mon Jul 3 16:29:21 2006
@@ -20,7 +20,6 @@
import com.opensymphony.xwork.ActionContext;
import com.opensymphony.xwork.ActionSupport;
import com.opensymphony.xwork.ObjectFactory;
-import com.opensymphony.xwork.XWorkStatic;
import com.opensymphony.xwork.config.RuntimeConfiguration;
import com.opensymphony.xwork.config.entities.ActionConfig;
import com.opensymphony.xwork.config.entities.InterceptorMapping;
@@ -114,12 +113,12 @@
*/
public void testFormWithCustomOnsubmitEnabledWithValidateEnabled1() throws Exception {
- com.opensymphony.xwork.config.Configuration originalConfiguration = XWorkStatic.getConfigurationManager().getConfiguration();
+ com.opensymphony.xwork.config.Configuration originalConfiguration = configurationManager.getConfiguration();
ObjectFactory originalObjectFactory = ObjectFactory.getObjectFactory();
try {
// used to determined if the form action needs js validation
- XWorkStatic.getConfigurationManager().setConfiguration(new com.opensymphony.xwork.config.impl.DefaultConfiguration() {
+ configurationManager.setConfiguration(new com.opensymphony.xwork.config.impl.DefaultConfiguration() {
public RuntimeConfiguration getRuntimeConfiguration() {
return new RuntimeConfiguration() {
public ActionConfig getActionConfig(String namespace, String name) {
@@ -184,7 +183,7 @@
verify(FormTag.class.getResource("Formtag-2.txt"));
}
finally {
- XWorkStatic.getConfigurationManager().setConfiguration(originalConfiguration);
+ configurationManager.setConfiguration(originalConfiguration);
ObjectFactory.setObjectFactory(originalObjectFactory);
}
}
@@ -197,12 +196,12 @@
*/
public void testFormWithCustomOnsubmitEnabledWithValidateEnabled2() throws Exception {
- com.opensymphony.xwork.config.Configuration originalConfiguration = XWorkStatic.getConfigurationManager().getConfiguration();
+ com.opensymphony.xwork.config.Configuration originalConfiguration = configurationManager.getConfiguration();
ObjectFactory originalObjectFactory = ObjectFactory.getObjectFactory();
try {
// used to determined if the form action needs js validation
- XWorkStatic.getConfigurationManager().setConfiguration(new com.opensymphony.xwork.config.impl.DefaultConfiguration() {
+ configurationManager.setConfiguration(new com.opensymphony.xwork.config.impl.DefaultConfiguration() {
public RuntimeConfiguration getRuntimeConfiguration() {
return new RuntimeConfiguration() {
public ActionConfig getActionConfig(String namespace, String name) {
@@ -267,7 +266,7 @@
verify(FormTag.class.getResource("Formtag-11.txt"));
}
finally {
- XWorkStatic.getConfigurationManager().setConfiguration(originalConfiguration);
+ configurationManager.setConfiguration(originalConfiguration);
ObjectFactory.setObjectFactory(originalObjectFactory);
}
}
@@ -542,8 +541,8 @@
protected void setUp() throws Exception {
super.setUp();
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().addConfigurationProvider(new TestConfigurationProvider());
+ configurationManager.clearConfigurationProviders();
+ configurationManager.addConfigurationProvider(new TestConfigurationProvider());
ActionContext.getContext().setValueStack(stack);
}
}
Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java?rev=418872&r1=418871&r2=418872&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java Mon Jul 3 16:29:21 2006
@@ -18,7 +18,6 @@
package org.apache.struts2.views.jsp.ui;
import com.mockobjects.servlet.MockJspWriter;
-import com.opensymphony.xwork.XWorkStatic;
import org.apache.struts2.TestConfigurationProvider;
import org.apache.struts2.views.jsp.AbstractUITagTest;
import org.apache.struts2.views.jsp.ParamTag;
@@ -31,8 +30,8 @@
public void testWithoutFormOverriding() throws Exception {
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().addConfigurationProvider(new TestConfigurationProvider());
+ configurationManager.clearConfigurationProviders();
+ configurationManager.addConfigurationProvider(new TestConfigurationProvider());
// we test it on textfield component, but since the tooltip are common to
// all components, it will be the same for other components as well.
@@ -92,8 +91,8 @@
public void testWithFormOverriding() throws Exception {
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().addConfigurationProvider(new TestConfigurationProvider());
+ configurationManager.clearConfigurationProviders();
+ configurationManager.addConfigurationProvider(new TestConfigurationProvider());
FormTag formTag = new FormTag();
formTag.setPageContext(pageContext);
@@ -151,8 +150,8 @@
public void testWithPartialFormOverriding() throws Exception {
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().addConfigurationProvider(new TestConfigurationProvider());
+ configurationManager.clearConfigurationProviders();
+ configurationManager.addConfigurationProvider(new TestConfigurationProvider());
FormTag formTag = new FormTag();
formTag.setName("myForm");
@@ -218,8 +217,8 @@
public void testUsingParamValueToSetConfigurations() throws Exception {
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().addConfigurationProvider(new TestConfigurationProvider());
+ configurationManager.clearConfigurationProviders();
+ configurationManager.addConfigurationProvider(new TestConfigurationProvider());
FormTag formTag = new FormTag();
formTag.setName("myForm");
@@ -296,8 +295,8 @@
public void testUsingParamBodyValueToSetConfigurations() throws Exception {
- XWorkStatic.getConfigurationManager().clearConfigurationProviders();
- XWorkStatic.getConfigurationManager().addConfigurationProvider(new TestConfigurationProvider());
+ configurationManager.clearConfigurationProviders();
+ configurationManager.addConfigurationProvider(new TestConfigurationProvider());
FormTag formTag = new FormTag();
formTag.setName("myForm");