mirror of
https://github.com/apache/struts.git
synced 2026-08-06 15:17:00 +00:00
Merge pull request #452 from apache/WW-5078-removes-xwork-dtds
[WW-5078] Removes support for <xwork> DTDs
This commit is contained in:
@@ -19,8 +19,7 @@
|
||||
package com.opensymphony.xwork2.config;
|
||||
|
||||
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
|
||||
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
@@ -86,8 +85,8 @@ public class ConfigurationManager {
|
||||
/**
|
||||
* <p>
|
||||
* Get the current list of ConfigurationProviders. If no custom ConfigurationProviders have been added, this method
|
||||
* will return a list containing only the default ConfigurationProvider, XMLConfigurationProvider. If a custom
|
||||
* ConfigurationProvider has been added, then the XmlConfigurationProvider must be added by hand.
|
||||
* will return a list containing only a default ConfigurationProvider, {@link StrutsDefaultConfigurationProvider}.
|
||||
* If a custom ConfigurationProvider has been added, then the StrutsDefaultConfigurationProvider must be added by hand.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
@@ -101,8 +100,7 @@ public class ConfigurationManager {
|
||||
providerLock.lock();
|
||||
try {
|
||||
if (containerProviders.size() == 0) {
|
||||
containerProviders.add(new XWorkConfigurationProvider());
|
||||
containerProviders.add(new XmlConfigurationProvider("xwork.xml", false));
|
||||
containerProviders.add(new StrutsDefaultConfigurationProvider());
|
||||
}
|
||||
|
||||
return containerProviders;
|
||||
@@ -160,7 +158,7 @@ public class ConfigurationManager {
|
||||
*/
|
||||
public synchronized void destroyConfiguration() {
|
||||
clearContainerProviders(); // let's destroy the ConfigurationProvider first
|
||||
containerProviders = new CopyOnWriteArrayList<ContainerProvider>();
|
||||
containerProviders = new CopyOnWriteArrayList<>();
|
||||
if (configuration != null)
|
||||
configuration.destroy(); // let's destroy it first, before nulling it.
|
||||
configuration = null;
|
||||
|
||||
@@ -21,7 +21,7 @@ package com.opensymphony.xwork2.config.impl;
|
||||
import com.opensymphony.xwork2.config.*;
|
||||
import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.config.entities.UnknownHandlerConfig;
|
||||
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
import com.opensymphony.xwork2.inject.ContainerBuilder;
|
||||
import com.opensymphony.xwork2.inject.Scope;
|
||||
@@ -50,7 +50,7 @@ public class MockConfiguration implements Configuration {
|
||||
//this cannot be done in the constructor, as it causes an infinite loop
|
||||
builder.factory(Configuration.class, MockConfiguration.class, Scope.SINGLETON);
|
||||
LocatableProperties props = new LocatableProperties();
|
||||
new XWorkConfigurationProvider().register(builder, props);
|
||||
new StrutsDefaultConfigurationProvider().register(builder, props);
|
||||
builder.constant(StrutsConstants.STRUTS_DEVMODE, "false");
|
||||
builder.constant(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, "true");
|
||||
builder.constant(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE, "true");
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class XWorkConfigurationProvider implements ConfigurationProvider {
|
||||
public class StrutsDefaultConfigurationProvider implements ConfigurationProvider {
|
||||
|
||||
public void destroy() {
|
||||
}
|
||||
+13
-32
@@ -72,6 +72,7 @@ import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.Vector;
|
||||
|
||||
@@ -85,48 +86,36 @@ import java.util.Vector;
|
||||
* @author Neo
|
||||
* @version $Revision$
|
||||
*/
|
||||
public class XmlConfigurationProvider implements ConfigurationProvider {
|
||||
public abstract class XmlConfigurationProvider implements ConfigurationProvider {
|
||||
|
||||
private static final Logger LOG = LogManager.getLogger(XmlConfigurationProvider.class);
|
||||
|
||||
private final String configFileName;
|
||||
private final Set<String> loadedFileUrls = new HashSet<>();
|
||||
private final Map<String, Element> declaredPackages = new HashMap<>();
|
||||
|
||||
private List<Document> documents;
|
||||
private Set<String> includedFileNames;
|
||||
private String configFileName;
|
||||
private ObjectFactory objectFactory;
|
||||
|
||||
private final Set<String> loadedFileUrls = new HashSet<>();
|
||||
private boolean errorIfMissing;
|
||||
private Map<String, String> dtdMappings;
|
||||
private Map<String, String> dtdMappings = new HashMap<>();
|
||||
private Configuration configuration;
|
||||
|
||||
private boolean throwExceptionOnDuplicateBeans = true;
|
||||
private final Map<String, Element> declaredPackages = new HashMap<>();
|
||||
|
||||
private FileManager fileManager;
|
||||
private ValueSubstitutor valueSubstitutor;
|
||||
|
||||
public XmlConfigurationProvider() {
|
||||
this("xwork.xml", true);
|
||||
this("struts.xml", true);
|
||||
}
|
||||
|
||||
public XmlConfigurationProvider(String filename) {
|
||||
this(filename, true);
|
||||
}
|
||||
|
||||
public XmlConfigurationProvider(String filename, boolean errorIfMissing) {
|
||||
public XmlConfigurationProvider(String filename, @Deprecated boolean notUsed) {
|
||||
this.configFileName = filename;
|
||||
this.errorIfMissing = errorIfMissing;
|
||||
|
||||
Map<String, String> mappings = new HashMap<>();
|
||||
mappings.put("-//Apache Struts//XWork 2.6//EN", "xwork-2.6.dtd");
|
||||
mappings.put("-//Apache Struts//XWork 2.5//EN", "xwork-2.5.dtd");
|
||||
mappings.put("-//Apache Struts//XWork 2.3//EN", "xwork-2.3.dtd");
|
||||
mappings.put("-//Apache Struts//XWork 2.1.3//EN", "xwork-2.1.3.dtd");
|
||||
mappings.put("-//Apache Struts//XWork 2.1//EN", "xwork-2.1.dtd");
|
||||
mappings.put("-//Apache Struts//XWork 2.0//EN", "xwork-2.0.dtd");
|
||||
mappings.put("-//Apache Struts//XWork 1.1.1//EN", "xwork-1.1.1.dtd");
|
||||
mappings.put("-//Apache Struts//XWork 1.1//EN", "xwork-1.1.dtd");
|
||||
mappings.put("-//Apache Struts//XWork 1.0//EN", "xwork-1.0.dtd");
|
||||
setDtdMappings(mappings);
|
||||
}
|
||||
|
||||
public void setThrowExceptionOnDuplicateBeans(boolean val) {
|
||||
@@ -182,11 +171,7 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
|
||||
|
||||
final XmlConfigurationProvider xmlConfigurationProvider = (XmlConfigurationProvider) o;
|
||||
|
||||
if ((configFileName != null) ? (!configFileName.equals(xmlConfigurationProvider.configFileName)) : (xmlConfigurationProvider.configFileName != null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return Objects.equals(configFileName, xmlConfigurationProvider.configFileName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1078,12 +1063,8 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
|
||||
}
|
||||
|
||||
if (urls == null || !urls.hasNext()) {
|
||||
if (errorIfMissing) {
|
||||
throw new ConfigurationException("Could not open files of the name " + fileName, ioException);
|
||||
} else {
|
||||
LOG.trace("Unable to locate configuration files of the name {}, skipping", fileName);
|
||||
return docs;
|
||||
}
|
||||
LOG.debug("Ignoring file that does not exist: " + fileName, ioException);
|
||||
return docs;
|
||||
}
|
||||
|
||||
URL url = null;
|
||||
|
||||
@@ -20,7 +20,7 @@ package com.opensymphony.xwork2.util;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.config.*;
|
||||
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
import com.opensymphony.xwork2.inject.ContainerBuilder;
|
||||
@@ -33,7 +33,7 @@ public class XWorkTestCaseHelper {
|
||||
|
||||
public static ConfigurationManager setUp() throws Exception {
|
||||
ConfigurationManager configurationManager = new ConfigurationManager(Container.DEFAULT_NAME);
|
||||
configurationManager.addContainerProvider(new XWorkConfigurationProvider());
|
||||
configurationManager.addContainerProvider(new StrutsDefaultConfigurationProvider());
|
||||
Configuration config = configurationManager.getConfiguration();
|
||||
Container container = config.getContainer();
|
||||
|
||||
@@ -62,7 +62,7 @@ public class XWorkTestCaseHelper {
|
||||
}
|
||||
|
||||
});
|
||||
configurationManager.addContainerProvider(new XWorkConfigurationProvider());
|
||||
configurationManager.addContainerProvider(new StrutsDefaultConfigurationProvider());
|
||||
for (ConfigurationProvider prov : providers) {
|
||||
if (prov instanceof XmlConfigurationProvider) {
|
||||
((XmlConfigurationProvider)prov).setThrowExceptionOnDuplicateBeans(false);
|
||||
|
||||
@@ -51,10 +51,20 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
|
||||
*
|
||||
* @param errorIfMissing If we should throw an exception if the file can't be found
|
||||
*/
|
||||
@Deprecated
|
||||
public StrutsXmlConfigurationProvider(boolean errorIfMissing) {
|
||||
this("struts.xml", errorIfMissing, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the configuration provider based on the provided config file
|
||||
*
|
||||
* @param filename file with Struts configuration
|
||||
*/
|
||||
public StrutsXmlConfigurationProvider(String filename) {
|
||||
this(filename, false, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the configuration provider
|
||||
*
|
||||
@@ -66,7 +76,7 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
|
||||
super(filename, errorIfMissing);
|
||||
this.servletContext = ctx;
|
||||
this.filename = filename;
|
||||
reloadKey = "configurationReload-"+filename;
|
||||
reloadKey = "configurationReload-" + filename;
|
||||
Map<String,String> dtdMappings = new HashMap<String,String>(getDtdMappings());
|
||||
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.0//EN", "struts-2.0.dtd");
|
||||
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.1//EN", "struts-2.1.dtd");
|
||||
|
||||
@@ -446,7 +446,7 @@ public class Dispatcher {
|
||||
String[] classes = configClasses.split("\\s*[,]\\s*");
|
||||
for (String cname : classes) {
|
||||
try {
|
||||
Class cls = ClassLoaderUtil.loadClass(cname, this.getClass());
|
||||
Class<?> cls = ClassLoaderUtil.loadClass(cname, this.getClass());
|
||||
StrutsJavaConfiguration config = (StrutsJavaConfiguration) cls.newInstance();
|
||||
configurationManager.addContainerProvider(createJavaConfigurationProvider(config));
|
||||
} catch (InstantiationException e) {
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
and {@link com.opensymphony.xwork2.inject.Inject}
|
||||
-->
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.6//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.6.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
@@ -401,10 +401,10 @@
|
||||
<interceptor-ref name="coepInterceptor">
|
||||
<param name="enforcingMode">false</param>
|
||||
<param name="disabled">false</param>
|
||||
<param name="exemptedPaths"></param>
|
||||
<param name="exemptedPaths"/>
|
||||
</interceptor-ref>
|
||||
<interceptor-ref name="coopInterceptor">
|
||||
<param name="exemptedPaths"></param>
|
||||
<param name="exemptedPaths"/>
|
||||
<param name="mode">same-origin</param>
|
||||
</interceptor-ref>
|
||||
<interceptor-ref name="fetchMetadata"/>
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you 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.
|
||||
*/
|
||||
-->
|
||||
<!--
|
||||
XWork Configuraion DTD.
|
||||
Use the following DOCTYPE.
|
||||
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.0.dtd">
|
||||
-->
|
||||
|
||||
<!ELEMENT xwork (package|include)*>
|
||||
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, global-results?, action*)>
|
||||
<!ATTLIST package
|
||||
name CDATA #REQUIRED
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
externalReferenceResolver NMTOKEN #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
<!ELEMENT result-type (param*)>
|
||||
<!ATTLIST result-type
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
default (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT interceptors (interceptor|interceptor-stack)+>
|
||||
|
||||
<!ELEMENT interceptor (param*)>
|
||||
<!ATTLIST interceptor
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-stack (interceptor-ref+)>
|
||||
<!ATTLIST interceptor-stack
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-ref (param*)>
|
||||
<!ATTLIST interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-interceptor-ref (param*)>
|
||||
<!ATTLIST default-interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT external-ref (#PCDATA)>
|
||||
<!ATTLIST external-ref
|
||||
name NMTOKEN #REQUIRED
|
||||
required (true|false) "true"
|
||||
>
|
||||
|
||||
<!ELEMENT global-results (result+)>
|
||||
|
||||
<!ELEMENT action (param|result|interceptor-ref|external-ref)*>
|
||||
<!ATTLIST action
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
method CDATA #IMPLIED
|
||||
converter CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT param (#PCDATA)>
|
||||
<!ATTLIST param
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT result (#PCDATA|param)*>
|
||||
<!ATTLIST result
|
||||
name CDATA #REQUIRED
|
||||
type CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT include (#PCDATA)>
|
||||
<!ATTLIST include
|
||||
file CDATA #REQUIRED
|
||||
>
|
||||
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you 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.
|
||||
*/
|
||||
-->
|
||||
<!-- START SNIPPET: xworkDtd -->
|
||||
|
||||
<!--
|
||||
XWork configuration DTD.
|
||||
Use the following DOCTYPE
|
||||
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd">
|
||||
-->
|
||||
|
||||
<!ELEMENT xwork (package|include)*>
|
||||
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, default-action-ref?, global-results?, global-exception-mappings?, action*)>
|
||||
<!ATTLIST package
|
||||
name CDATA #REQUIRED
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
externalReferenceResolver NMTOKEN #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
<!ELEMENT result-type (param*)>
|
||||
<!ATTLIST result-type
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
default (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT interceptors (interceptor|interceptor-stack)+>
|
||||
|
||||
<!ELEMENT interceptor (param*)>
|
||||
<!ATTLIST interceptor
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-stack (interceptor-ref+)>
|
||||
<!ATTLIST interceptor-stack
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-ref (param*)>
|
||||
<!ATTLIST interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-interceptor-ref (param*)>
|
||||
<!ATTLIST default-interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-action-ref (param*)>
|
||||
<!ATTLIST default-action-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT external-ref (#PCDATA)>
|
||||
<!ATTLIST external-ref
|
||||
name NMTOKEN #REQUIRED
|
||||
required (true|false) "true"
|
||||
>
|
||||
|
||||
<!ELEMENT global-results (result+)>
|
||||
|
||||
<!ELEMENT global-exception-mappings (exception-mapping+)>
|
||||
|
||||
<!ELEMENT action (param|result|interceptor-ref|exception-mapping|external-ref)*>
|
||||
<!ATTLIST action
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #IMPLIED
|
||||
method CDATA #IMPLIED
|
||||
converter CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT param (#PCDATA)>
|
||||
<!ATTLIST param
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT result (#PCDATA|param)*>
|
||||
<!ATTLIST result
|
||||
name CDATA #IMPLIED
|
||||
type CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT exception-mapping (#PCDATA|param)*>
|
||||
<!ATTLIST exception-mapping
|
||||
name CDATA #IMPLIED
|
||||
exception CDATA #REQUIRED
|
||||
result CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT include (#PCDATA)>
|
||||
<!ATTLIST include
|
||||
file CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- END SNIPPET: xworkDtd -->
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you 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.
|
||||
*/
|
||||
-->
|
||||
<!-- START SNIPPET: xworkDtd -->
|
||||
|
||||
<!--
|
||||
XWork configuration DTD.
|
||||
Use the following DOCTYPE
|
||||
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.2.dtd">
|
||||
-->
|
||||
|
||||
<!ELEMENT xwork (parameters?, (package|include)*)>
|
||||
|
||||
<!ELEMENT parameters (parameter*)>
|
||||
|
||||
<!ELEMENT parameter (#PCDATA)>
|
||||
<!ATTLIST parameter
|
||||
name CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, default-action-ref?, global-results?, global-exception-mappings?, action*)>
|
||||
<!ATTLIST package
|
||||
name CDATA #REQUIRED
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
externalReferenceResolver NMTOKEN #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
<!ELEMENT result-type (param*)>
|
||||
<!ATTLIST result-type
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
default (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT interceptors (interceptor|interceptor-stack)+>
|
||||
|
||||
<!ELEMENT interceptor (param*)>
|
||||
<!ATTLIST interceptor
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-stack (interceptor-ref+)>
|
||||
<!ATTLIST interceptor-stack
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-ref (param*)>
|
||||
<!ATTLIST interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-interceptor-ref (param*)>
|
||||
<!ATTLIST default-interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-action-ref (param*)>
|
||||
<!ATTLIST default-action-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT external-ref (#PCDATA)>
|
||||
<!ATTLIST external-ref
|
||||
name NMTOKEN #REQUIRED
|
||||
required (true|false) "true"
|
||||
>
|
||||
|
||||
<!ELEMENT global-results (result+)>
|
||||
|
||||
<!ELEMENT global-exception-mappings (exception-mapping+)>
|
||||
|
||||
<!ELEMENT action (param|result|interceptor-ref|exception-mapping|external-ref)*>
|
||||
<!ATTLIST action
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #IMPLIED
|
||||
method CDATA #IMPLIED
|
||||
converter CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT param (#PCDATA)>
|
||||
<!ATTLIST param
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT result (#PCDATA|param)*>
|
||||
<!ATTLIST result
|
||||
name CDATA #IMPLIED
|
||||
type CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT exception-mapping (#PCDATA|param)*>
|
||||
<!ATTLIST exception-mapping
|
||||
name CDATA #IMPLIED
|
||||
exception CDATA #REQUIRED
|
||||
result CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT include (#PCDATA)>
|
||||
<!ATTLIST include
|
||||
file CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- END SNIPPET: xworkDtd -->
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you 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.
|
||||
*/
|
||||
-->
|
||||
<!--
|
||||
XWork configuration DTD.
|
||||
Use the following DOCTYPE
|
||||
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.dtd">
|
||||
-->
|
||||
|
||||
<!ELEMENT xwork (package|include)*>
|
||||
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, global-results?, global-exception-mappings?, action*)>
|
||||
<!ATTLIST package
|
||||
name CDATA #REQUIRED
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
externalReferenceResolver NMTOKEN #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
<!ELEMENT result-type (param*)>
|
||||
<!ATTLIST result-type
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
default (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT interceptors (interceptor|interceptor-stack)+>
|
||||
|
||||
<!ELEMENT interceptor (param*)>
|
||||
<!ATTLIST interceptor
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-stack (interceptor-ref+)>
|
||||
<!ATTLIST interceptor-stack
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-ref (param*)>
|
||||
<!ATTLIST interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-interceptor-ref (param*)>
|
||||
<!ATTLIST default-interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT external-ref (#PCDATA)>
|
||||
<!ATTLIST external-ref
|
||||
name NMTOKEN #REQUIRED
|
||||
required (true|false) "true"
|
||||
>
|
||||
|
||||
<!ELEMENT global-results (result+)>
|
||||
|
||||
<!ELEMENT global-exception-mappings (exception-mapping+)>
|
||||
|
||||
<!ELEMENT action (param|result|interceptor-ref|exception-mapping|external-ref)*>
|
||||
<!ATTLIST action
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #IMPLIED
|
||||
method CDATA #IMPLIED
|
||||
converter CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT param (#PCDATA)>
|
||||
<!ATTLIST param
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT result (#PCDATA|param)*>
|
||||
<!ATTLIST result
|
||||
name CDATA #IMPLIED
|
||||
type CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT exception-mapping (#PCDATA|param)*>
|
||||
<!ATTLIST exception-mapping
|
||||
name CDATA #IMPLIED
|
||||
exception CDATA #REQUIRED
|
||||
result CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT include (#PCDATA)>
|
||||
<!ATTLIST include
|
||||
file CDATA #REQUIRED
|
||||
>
|
||||
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you 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.
|
||||
*/
|
||||
-->
|
||||
<!-- START SNIPPET: xworkDtd -->
|
||||
|
||||
<!--
|
||||
XWork configuration DTD.
|
||||
Use the following DOCTYPE
|
||||
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.0.dtd">
|
||||
-->
|
||||
|
||||
<!ELEMENT xwork (package|include|bean|constant)*>
|
||||
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, default-action-ref?, default-class-ref?, global-results?, global-exception-mappings?, action*)>
|
||||
<!ATTLIST package
|
||||
name CDATA #REQUIRED
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
<!ELEMENT result-type (param*)>
|
||||
<!ATTLIST result-type
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
default (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT interceptors (interceptor|interceptor-stack)+>
|
||||
|
||||
<!ELEMENT interceptor (param*)>
|
||||
<!ATTLIST interceptor
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-stack (interceptor-ref*)>
|
||||
<!ATTLIST interceptor-stack
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-ref (param*)>
|
||||
<!ATTLIST interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-interceptor-ref (#PCDATA)>
|
||||
<!ATTLIST default-interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-action-ref (#PCDATA)>
|
||||
<!ATTLIST default-action-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-class-ref (#PCDATA)>
|
||||
<!ATTLIST default-class-ref
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT global-results (result+)>
|
||||
|
||||
<!ELEMENT global-exception-mappings (exception-mapping+)>
|
||||
|
||||
<!ELEMENT action (param|result|interceptor-ref|exception-mapping)*>
|
||||
<!ATTLIST action
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #IMPLIED
|
||||
method CDATA #IMPLIED
|
||||
converter CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT param (#PCDATA)>
|
||||
<!ATTLIST param
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT result (#PCDATA|param)*>
|
||||
<!ATTLIST result
|
||||
name CDATA #IMPLIED
|
||||
type CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT exception-mapping (#PCDATA|param)*>
|
||||
<!ATTLIST exception-mapping
|
||||
name CDATA #IMPLIED
|
||||
exception CDATA #REQUIRED
|
||||
result CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT include (#PCDATA)>
|
||||
<!ATTLIST include
|
||||
file CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT bean (#PCDATA)>
|
||||
<!ATTLIST bean
|
||||
type CDATA #IMPLIED
|
||||
name CDATA #IMPLIED
|
||||
class CDATA #REQUIRED
|
||||
scope CDATA #IMPLIED
|
||||
static CDATA #IMPLIED
|
||||
optional CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT constant (#PCDATA)>
|
||||
<!ATTLIST constant
|
||||
name CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- END SNIPPET: xworkDtd -->
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you 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.
|
||||
*/
|
||||
-->
|
||||
<!-- START SNIPPET: xworkDtd -->
|
||||
|
||||
<!--
|
||||
XWork configuration DTD.
|
||||
Use the following DOCTYPE
|
||||
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.1.3//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.1.3.dtd">
|
||||
-->
|
||||
|
||||
<!ELEMENT xwork ((package|include|bean|constant)*, unknown-handler-stack?)>
|
||||
<!ATTLIST xwork
|
||||
order CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, default-action-ref?, default-class-ref?, global-results?, global-exception-mappings?, action*)>
|
||||
<!ATTLIST package
|
||||
name CDATA #REQUIRED
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
<!ELEMENT result-type (param*)>
|
||||
<!ATTLIST result-type
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
default (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT interceptors (interceptor|interceptor-stack)+>
|
||||
|
||||
<!ELEMENT interceptor (param*)>
|
||||
<!ATTLIST interceptor
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-stack (interceptor-ref*)>
|
||||
<!ATTLIST interceptor-stack
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-ref (param*)>
|
||||
<!ATTLIST interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-interceptor-ref (#PCDATA)>
|
||||
<!ATTLIST default-interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-action-ref (#PCDATA)>
|
||||
<!ATTLIST default-action-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-class-ref (#PCDATA)>
|
||||
<!ATTLIST default-class-ref
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT global-results (result+)>
|
||||
|
||||
<!ELEMENT global-exception-mappings (exception-mapping+)>
|
||||
|
||||
<!ELEMENT action (param|result|interceptor-ref|exception-mapping)*>
|
||||
<!ATTLIST action
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #IMPLIED
|
||||
method CDATA #IMPLIED
|
||||
converter CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT param (#PCDATA)>
|
||||
<!ATTLIST param
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT result (#PCDATA|param)*>
|
||||
<!ATTLIST result
|
||||
name CDATA #IMPLIED
|
||||
type CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT exception-mapping (#PCDATA|param)*>
|
||||
<!ATTLIST exception-mapping
|
||||
name CDATA #IMPLIED
|
||||
exception CDATA #REQUIRED
|
||||
result CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT include (#PCDATA)>
|
||||
<!ATTLIST include
|
||||
file CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT bean (#PCDATA)>
|
||||
<!ATTLIST bean
|
||||
type CDATA #IMPLIED
|
||||
name CDATA #IMPLIED
|
||||
class CDATA #REQUIRED
|
||||
scope CDATA #IMPLIED
|
||||
static CDATA #IMPLIED
|
||||
optional CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT constant (#PCDATA)>
|
||||
<!ATTLIST constant
|
||||
name CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT unknown-handler-stack (unknown-handler-ref*)>
|
||||
<!ELEMENT unknown-handler-ref (#PCDATA)>
|
||||
<!ATTLIST unknown-handler-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- END SNIPPET: xworkDtd -->
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you 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.
|
||||
*/
|
||||
-->
|
||||
<!-- START SNIPPET: xworkDtd -->
|
||||
|
||||
<!--
|
||||
XWork configuration DTD.
|
||||
Use the following DOCTYPE
|
||||
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.1.dtd">
|
||||
-->
|
||||
|
||||
<!ELEMENT xwork ((package|include|bean|constant)*, unknown-handler-stack?)>
|
||||
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, default-action-ref?, default-class-ref?, global-results?, global-exception-mappings?, action*)>
|
||||
<!ATTLIST package
|
||||
name CDATA #REQUIRED
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
<!ELEMENT result-type (param*)>
|
||||
<!ATTLIST result-type
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
default (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT interceptors (interceptor|interceptor-stack)+>
|
||||
|
||||
<!ELEMENT interceptor (param*)>
|
||||
<!ATTLIST interceptor
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-stack (interceptor-ref*)>
|
||||
<!ATTLIST interceptor-stack
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-ref (param*)>
|
||||
<!ATTLIST interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-interceptor-ref (#PCDATA)>
|
||||
<!ATTLIST default-interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-action-ref (#PCDATA)>
|
||||
<!ATTLIST default-action-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-class-ref (#PCDATA)>
|
||||
<!ATTLIST default-class-ref
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT global-results (result+)>
|
||||
|
||||
<!ELEMENT global-exception-mappings (exception-mapping+)>
|
||||
|
||||
<!ELEMENT action (param|result|interceptor-ref|exception-mapping)*>
|
||||
<!ATTLIST action
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #IMPLIED
|
||||
method CDATA #IMPLIED
|
||||
converter CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT param (#PCDATA)>
|
||||
<!ATTLIST param
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT result (#PCDATA|param)*>
|
||||
<!ATTLIST result
|
||||
name CDATA #IMPLIED
|
||||
type CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT exception-mapping (#PCDATA|param)*>
|
||||
<!ATTLIST exception-mapping
|
||||
name CDATA #IMPLIED
|
||||
exception CDATA #REQUIRED
|
||||
result CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT include (#PCDATA)>
|
||||
<!ATTLIST include
|
||||
file CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT bean (#PCDATA)>
|
||||
<!ATTLIST bean
|
||||
type CDATA #IMPLIED
|
||||
name CDATA #IMPLIED
|
||||
class CDATA #REQUIRED
|
||||
scope CDATA #IMPLIED
|
||||
static CDATA #IMPLIED
|
||||
optional CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT constant (#PCDATA)>
|
||||
<!ATTLIST constant
|
||||
name CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT unknown-handler-stack (unknown-handler-ref*)>
|
||||
<!ELEMENT unknown-handler-ref (#PCDATA)>
|
||||
<!ATTLIST unknown-handler-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- END SNIPPET: xworkDtd -->
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you 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.
|
||||
*/
|
||||
-->
|
||||
<!-- START SNIPPET: xworkDtd -->
|
||||
|
||||
<!--
|
||||
XWork configuration DTD.
|
||||
Use the following DOCTYPE
|
||||
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.3//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.3.dtd">
|
||||
-->
|
||||
|
||||
<!ELEMENT xwork ((package|include|bean|constant)*, unknown-handler-stack?)>
|
||||
<!ATTLIST xwork
|
||||
order CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, default-action-ref?, default-class-ref?, global-results?, global-exception-mappings?, action*)>
|
||||
<!ATTLIST package
|
||||
name CDATA #REQUIRED
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
strict-method-invocation CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
<!ELEMENT result-type (param*)>
|
||||
<!ATTLIST result-type
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
default (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT interceptors (interceptor|interceptor-stack)+>
|
||||
|
||||
<!ELEMENT interceptor (param*)>
|
||||
<!ATTLIST interceptor
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-stack (interceptor-ref*)>
|
||||
<!ATTLIST interceptor-stack
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-ref (param*)>
|
||||
<!ATTLIST interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-interceptor-ref (#PCDATA)>
|
||||
<!ATTLIST default-interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-action-ref (#PCDATA)>
|
||||
<!ATTLIST default-action-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-class-ref (#PCDATA)>
|
||||
<!ATTLIST default-class-ref
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT global-results (result+)>
|
||||
|
||||
<!ELEMENT global-exception-mappings (exception-mapping+)>
|
||||
|
||||
<!ELEMENT action ((param|result|interceptor-ref|exception-mapping)*,allowed-methods?)>
|
||||
<!ATTLIST action
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #IMPLIED
|
||||
method CDATA #IMPLIED
|
||||
converter CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT param (#PCDATA)>
|
||||
<!ATTLIST param
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT result (#PCDATA|param)*>
|
||||
<!ATTLIST result
|
||||
name CDATA #IMPLIED
|
||||
type CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT exception-mapping (#PCDATA|param)*>
|
||||
<!ATTLIST exception-mapping
|
||||
name CDATA #IMPLIED
|
||||
exception CDATA #REQUIRED
|
||||
result CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT allowed-methods (#PCDATA)>
|
||||
|
||||
<!ELEMENT include (#PCDATA)>
|
||||
<!ATTLIST include
|
||||
file CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT bean (#PCDATA)>
|
||||
<!ATTLIST bean
|
||||
type CDATA #IMPLIED
|
||||
name CDATA #IMPLIED
|
||||
class CDATA #REQUIRED
|
||||
scope CDATA #IMPLIED
|
||||
static CDATA #IMPLIED
|
||||
optional CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT constant (#PCDATA)>
|
||||
<!ATTLIST constant
|
||||
name CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT unknown-handler-stack (unknown-handler-ref*)>
|
||||
<!ELEMENT unknown-handler-ref (#PCDATA)>
|
||||
<!ATTLIST unknown-handler-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- END SNIPPET: xworkDtd -->
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you 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.
|
||||
*/
|
||||
-->
|
||||
<!-- START SNIPPET: xworkDtd -->
|
||||
|
||||
<!--
|
||||
XWork configuration DTD.
|
||||
Use the following DOCTYPE
|
||||
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.5//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.5.dtd">
|
||||
-->
|
||||
|
||||
<!ELEMENT xwork ((package|include|bean|constant)*, unknown-handler-stack?)>
|
||||
<!ATTLIST xwork
|
||||
order CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, default-action-ref?, default-class-ref?, global-results?, global-allowed-methods?, global-exception-mappings?, action*)>
|
||||
<!ATTLIST package
|
||||
name CDATA #REQUIRED
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
strict-method-invocation (true|false) "true"
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
<!ELEMENT result-type (param*)>
|
||||
<!ATTLIST result-type
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
default (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT interceptors (interceptor|interceptor-stack)+>
|
||||
|
||||
<!ELEMENT interceptor (param*)>
|
||||
<!ATTLIST interceptor
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-stack (interceptor-ref*)>
|
||||
<!ATTLIST interceptor-stack
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-ref (param*)>
|
||||
<!ATTLIST interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-interceptor-ref (#PCDATA)>
|
||||
<!ATTLIST default-interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-action-ref (#PCDATA)>
|
||||
<!ATTLIST default-action-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-class-ref (#PCDATA)>
|
||||
<!ATTLIST default-class-ref
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT global-results (result+)>
|
||||
|
||||
<!ELEMENT global-allowed-methods (#PCDATA)>
|
||||
|
||||
<!ELEMENT global-exception-mappings (exception-mapping+)>
|
||||
|
||||
<!ELEMENT action ((param|result|interceptor-ref|exception-mapping)*,allowed-methods?)>
|
||||
<!ATTLIST action
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #IMPLIED
|
||||
method CDATA #IMPLIED
|
||||
converter CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT param (#PCDATA)>
|
||||
<!ATTLIST param
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT result (#PCDATA|param)*>
|
||||
<!ATTLIST result
|
||||
name CDATA #IMPLIED
|
||||
type CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT exception-mapping (#PCDATA|param)*>
|
||||
<!ATTLIST exception-mapping
|
||||
name CDATA #IMPLIED
|
||||
exception CDATA #REQUIRED
|
||||
result CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT allowed-methods (#PCDATA)>
|
||||
|
||||
<!ELEMENT include (#PCDATA)>
|
||||
<!ATTLIST include
|
||||
file CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT bean (#PCDATA)>
|
||||
<!ATTLIST bean
|
||||
type CDATA #IMPLIED
|
||||
name CDATA #IMPLIED
|
||||
class CDATA #REQUIRED
|
||||
scope CDATA #IMPLIED
|
||||
static CDATA #IMPLIED
|
||||
optional CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT constant (#PCDATA)>
|
||||
<!ATTLIST constant
|
||||
name CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT unknown-handler-stack (unknown-handler-ref*)>
|
||||
<!ELEMENT unknown-handler-ref (#PCDATA)>
|
||||
<!ATTLIST unknown-handler-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- END SNIPPET: xworkDtd -->
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you 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.
|
||||
*/
|
||||
-->
|
||||
<!-- START SNIPPET: xworkDtd -->
|
||||
|
||||
<!--
|
||||
XWork configuration DTD.
|
||||
Use the following DOCTYPE
|
||||
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.6//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.6.dtd">
|
||||
-->
|
||||
|
||||
<!ELEMENT xwork ((package|include|bean|constant)*, bean-selection?, unknown-handler-stack?)>
|
||||
<!ATTLIST xwork
|
||||
order CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, default-action-ref?, default-class-ref?, global-results?, global-allowed-methods?, global-exception-mappings?, action*)>
|
||||
<!ATTLIST package
|
||||
name CDATA #REQUIRED
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
strict-method-invocation (true|false) "true"
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
<!ELEMENT result-type (param*)>
|
||||
<!ATTLIST result-type
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
default (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT interceptors (interceptor|interceptor-stack)+>
|
||||
|
||||
<!ELEMENT interceptor (param*)>
|
||||
<!ATTLIST interceptor
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-stack (interceptor-ref*)>
|
||||
<!ATTLIST interceptor-stack
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-ref (param*)>
|
||||
<!ATTLIST interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-interceptor-ref (#PCDATA)>
|
||||
<!ATTLIST default-interceptor-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-action-ref (#PCDATA)>
|
||||
<!ATTLIST default-action-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-class-ref (#PCDATA)>
|
||||
<!ATTLIST default-class-ref
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT global-results (result+)>
|
||||
|
||||
<!ELEMENT global-allowed-methods (#PCDATA)>
|
||||
|
||||
<!ELEMENT global-exception-mappings (exception-mapping+)>
|
||||
|
||||
<!ELEMENT action ((param|result|interceptor-ref|exception-mapping)*,allowed-methods?)>
|
||||
<!ATTLIST action
|
||||
name CDATA #REQUIRED
|
||||
class CDATA #IMPLIED
|
||||
method CDATA #IMPLIED
|
||||
converter CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT param (#PCDATA)>
|
||||
<!ATTLIST param
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT result (#PCDATA|param)*>
|
||||
<!ATTLIST result
|
||||
name CDATA #IMPLIED
|
||||
type CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT exception-mapping (#PCDATA|param)*>
|
||||
<!ATTLIST exception-mapping
|
||||
name CDATA #IMPLIED
|
||||
exception CDATA #REQUIRED
|
||||
result CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT allowed-methods (#PCDATA)>
|
||||
|
||||
<!ELEMENT include (#PCDATA)>
|
||||
<!ATTLIST include
|
||||
file CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT bean (#PCDATA)>
|
||||
<!ATTLIST bean
|
||||
type CDATA #IMPLIED
|
||||
name CDATA #IMPLIED
|
||||
class CDATA #REQUIRED
|
||||
scope CDATA #IMPLIED
|
||||
static CDATA #IMPLIED
|
||||
optional CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT bean-selection (#PCDATA)>
|
||||
<!ATTLIST bean-selection
|
||||
name CDATA #IMPLIED
|
||||
class CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT constant (#PCDATA)>
|
||||
<!ATTLIST constant
|
||||
name CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT unknown-handler-stack (unknown-handler-ref*)>
|
||||
<!ELEMENT unknown-handler-ref (#PCDATA)>
|
||||
<!ATTLIST unknown-handler-ref
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!-- END SNIPPET: xworkDtd -->
|
||||
|
||||
@@ -19,11 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.0.dtd">
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<package name="xwork-default" abstract="true">
|
||||
|
||||
<!-- START SNIPPET: xwork2-default-result-types -->
|
||||
@@ -84,4 +83,4 @@
|
||||
<default-class-ref class="com.opensymphony.xwork2.ActionSupport"/>
|
||||
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
@@ -20,9 +20,10 @@ package com.opensymphony.xwork2;
|
||||
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
import com.opensymphony.xwork2.mock.MockResult;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -34,38 +35,40 @@ public class ActionInvocationTest extends XWorkTestCase {
|
||||
|
||||
public void testCommandInvocation() throws Exception {
|
||||
ActionProxy baseActionProxy = actionProxyFactory.createActionProxy(
|
||||
"baz", "commandTest", null, null);
|
||||
"baz", "commandTest", null, null);
|
||||
assertEquals("success", baseActionProxy.execute());
|
||||
|
||||
ActionProxy commandActionProxy = actionProxyFactory.createActionProxy(
|
||||
"baz", "myCommand", null, null);
|
||||
"baz", "myCommand", null, null);
|
||||
assertEquals(SimpleAction.COMMAND_RETURN_CODE, commandActionProxy.execute());
|
||||
}
|
||||
|
||||
public void testCommandInvocationDoMethod() throws Exception {
|
||||
ActionProxy baseActionProxy = actionProxyFactory.createActionProxy(
|
||||
"baz", "doMethodTest", null, null);
|
||||
"baz", "doMethodTest", null, null);
|
||||
assertEquals("input", baseActionProxy.execute());
|
||||
}
|
||||
|
||||
public void testCommandInvocationUnknownHandler() throws Exception {
|
||||
|
||||
UnknownHandler unknownHandler = new UnknownHandler() {
|
||||
public ActionConfig handleUnknownAction(String namespace, String actionName) throws StrutsException {
|
||||
public ActionConfig handleUnknownAction(String namespace, String actionName) throws StrutsException {
|
||||
return new ActionConfig.Builder("test", actionName, ActionSupport.class.getName())
|
||||
.addAllowedMethod("unknownmethod")
|
||||
.build();
|
||||
.addAllowedMethod("unknownmethod")
|
||||
.build();
|
||||
}
|
||||
|
||||
public Result handleUnknownResult(ActionContext actionContext, String actionName, ActionConfig actionConfig, String resultCode) throws StrutsException {
|
||||
return new MockResult();
|
||||
}
|
||||
|
||||
public Object handleUnknownActionMethod(Object action, String methodName) {
|
||||
if (methodName.equals("unknownmethod")) {
|
||||
return "found";
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public Result handleUnknownResult(ActionContext actionContext, String actionName, ActionConfig actionConfig, String resultCode) throws StrutsException {
|
||||
return new MockResult();
|
||||
}
|
||||
public Object handleUnknownActionMethod(Object action, String methodName) {
|
||||
if (methodName.equals("unknownmethod")) {
|
||||
return "found";
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
UnknownHandlerManagerMock uhm = new UnknownHandlerManagerMock();
|
||||
@@ -74,16 +77,16 @@ public class ActionInvocationTest extends XWorkTestCase {
|
||||
loadButAdd(UnknownHandlerManager.class, uhm);
|
||||
|
||||
DefaultActionProxy baseActionProxy = (DefaultActionProxy) actionProxyFactory.createActionProxy(
|
||||
"baz", "unknownMethodTest", "unknownmethod", null);
|
||||
"baz", "unknownMethodTest", "unknownmethod", null);
|
||||
|
||||
((DefaultActionInvocation)baseActionProxy.getInvocation()).setUnknownHandlerManager(uhm);
|
||||
((DefaultActionInvocation) baseActionProxy.getInvocation()).setUnknownHandlerManager(uhm);
|
||||
|
||||
assertEquals("found", baseActionProxy.execute());
|
||||
}
|
||||
|
||||
public void testResultReturnInvocationAndWired() throws Exception {
|
||||
ActionProxy baseActionProxy = actionProxyFactory.createActionProxy(
|
||||
"baz", "resultAction", null, null);
|
||||
"baz", "resultAction", null, null);
|
||||
assertNull(baseActionProxy.execute());
|
||||
assertTrue(SimpleAction.resultCalled);
|
||||
}
|
||||
@@ -96,7 +99,7 @@ public class ActionInvocationTest extends XWorkTestCase {
|
||||
extraContext.put(ActionContext.PARAMETERS, HttpParameters.create(params).build());
|
||||
|
||||
try {
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy( "", "Foo", null, extraContext);
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy("", "Foo", null, extraContext);
|
||||
proxy.execute();
|
||||
assertEquals("this is blah", proxy.getInvocation().getStack().findValue("[1].blah"));
|
||||
} catch (Exception e) {
|
||||
@@ -105,11 +108,12 @@ public class ActionInvocationTest extends XWorkTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
@Override protected void setUp() throws Exception {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
// ensure we're using the default configuration, not simple config
|
||||
XmlConfigurationProvider configurationProvider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider configurationProvider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(configurationProvider);
|
||||
loadConfigurationProviders(configurationProvider);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -38,7 +39,7 @@ public class ChainResultTest extends XWorkTestCase {
|
||||
super.setUp();
|
||||
|
||||
// ensure we're using the default configuration, not simple config
|
||||
XmlConfigurationProvider configurationProvider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider configurationProvider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(configurationProvider);
|
||||
loadConfigurationProviders(configurationProvider);
|
||||
}
|
||||
@@ -124,9 +125,9 @@ public class ChainResultTest extends XWorkTestCase {
|
||||
}
|
||||
|
||||
private class NamespaceActionNameTestActionProxyFactory implements ActionProxyFactory {
|
||||
private ActionProxy returnVal;
|
||||
private String expectedActionName;
|
||||
private String expectedNamespace;
|
||||
private final ActionProxy returnVal;
|
||||
private final String expectedActionName;
|
||||
private final String expectedNamespace;
|
||||
|
||||
NamespaceActionNameTestActionProxyFactory(String expectedNamespace, String expectedActionName, ActionProxy returnVal) {
|
||||
this.expectedNamespace = expectedNamespace;
|
||||
@@ -156,14 +157,14 @@ public class ChainResultTest extends XWorkTestCase {
|
||||
}
|
||||
|
||||
public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) {
|
||||
TestCase.assertEquals(expectedNamespace, namespace);
|
||||
TestCase.assertEquals(expectedNamespace, namespace);
|
||||
TestCase.assertEquals(expectedActionName, actionName);
|
||||
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
public ActionProxy createActionProxy(ActionInvocation actionInvocation, String namespace, String actionName, String methodName, boolean executeResult, boolean cleanupContext) {
|
||||
TestCase.assertEquals(expectedNamespace, namespace);
|
||||
TestCase.assertEquals(expectedNamespace, namespace);
|
||||
TestCase.assertEquals(expectedActionName, actionName);
|
||||
|
||||
return returnVal;
|
||||
@@ -177,7 +178,7 @@ public class ChainResultTest extends XWorkTestCase {
|
||||
}
|
||||
|
||||
public ActionProxy createActionProxy(ActionInvocation inv, String namespace, String actionName,
|
||||
Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) throws Exception {
|
||||
Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) throws Exception {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.opensymphony.xwork2.mock.MockResult;
|
||||
import com.opensymphony.xwork2.ognl.OgnlUtil;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.ValueStackFactory;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -304,7 +305,7 @@ public class DefaultActionInvocationTest extends XWorkTestCase {
|
||||
DefaultActionInvocation defaultActionInvocation = new DefaultActionInvocation(extraContext, true);
|
||||
container.inject(defaultActionInvocation);
|
||||
|
||||
ActionProxy actionProxy = actionProxyFactory.createActionProxy( "", "LazyFoo", null, extraContext);
|
||||
ActionProxy actionProxy = actionProxyFactory.createActionProxy("", "LazyFoo", null, extraContext);
|
||||
defaultActionInvocation.init(actionProxy);
|
||||
defaultActionInvocation.invoke();
|
||||
|
||||
@@ -322,6 +323,7 @@ public class DefaultActionInvocationTest extends XWorkTestCase {
|
||||
lock.acquire();
|
||||
dai.setAsyncManager(new AsyncManager() {
|
||||
Object asyncActionResult;
|
||||
|
||||
@Override
|
||||
public boolean hasAsyncActionResult() {
|
||||
return asyncActionResult != null;
|
||||
@@ -384,7 +386,7 @@ public class DefaultActionInvocationTest extends XWorkTestCase {
|
||||
assertFalse("invocation should not be executed", dai.executed);
|
||||
assertNull("a null result should be passed to upper and wait for the async result", dai.resultCode);
|
||||
|
||||
if(lock.tryAcquire(1500L, TimeUnit.MILLISECONDS)) {
|
||||
if (lock.tryAcquire(1500L, TimeUnit.MILLISECONDS)) {
|
||||
try {
|
||||
dai.invoke();
|
||||
assertTrue("preResultListener should be executed", preResultExecuted[0]);
|
||||
@@ -402,7 +404,7 @@ public class DefaultActionInvocationTest extends XWorkTestCase {
|
||||
|
||||
public void testActionEventListener() throws Exception {
|
||||
ActionProxy actionProxy = actionProxyFactory.createActionProxy("",
|
||||
"ExceptionFoo", "exceptionMethod", new HashMap<String, Object>());
|
||||
"ExceptionFoo", "exceptionMethod", new HashMap<String, Object>());
|
||||
DefaultActionInvocation defaultActionInvocation = (DefaultActionInvocation) actionProxy.getInvocation();
|
||||
|
||||
SimpleActionEventListener actionEventListener = new SimpleActionEventListener("prepared", "exceptionHandled");
|
||||
@@ -428,7 +430,7 @@ public class DefaultActionInvocationTest extends XWorkTestCase {
|
||||
|
||||
public void testActionChainResult() throws Exception {
|
||||
ActionProxy actionProxy = actionProxyFactory.createActionProxy("", "Foo", null,
|
||||
new HashMap<String, Object>());
|
||||
new HashMap<String, Object>());
|
||||
DefaultActionInvocation defaultActionInvocation = (DefaultActionInvocation) actionProxy.getInvocation();
|
||||
defaultActionInvocation.init(actionProxy);
|
||||
|
||||
@@ -446,7 +448,7 @@ public class DefaultActionInvocationTest extends XWorkTestCase {
|
||||
|
||||
public void testNoResultDefined() throws Exception {
|
||||
ActionProxy actionProxy = actionProxyFactory.createActionProxy("", "Foo", null,
|
||||
new HashMap<String, Object>());
|
||||
new HashMap<String, Object>());
|
||||
DefaultActionInvocation defaultActionInvocation = (DefaultActionInvocation) actionProxy.getInvocation();
|
||||
defaultActionInvocation.init(actionProxy);
|
||||
|
||||
@@ -459,7 +461,7 @@ public class DefaultActionInvocationTest extends XWorkTestCase {
|
||||
|
||||
public void testNullResultPossible() throws Exception {
|
||||
ActionProxy actionProxy = actionProxyFactory.createActionProxy("",
|
||||
"NullFoo", "nullMethod", new HashMap<String, Object>());
|
||||
"NullFoo", "nullMethod", new HashMap<String, Object>());
|
||||
DefaultActionInvocation defaultActionInvocation = (DefaultActionInvocation) actionProxy.getInvocation();
|
||||
defaultActionInvocation.init(actionProxy);
|
||||
|
||||
@@ -473,7 +475,7 @@ public class DefaultActionInvocationTest extends XWorkTestCase {
|
||||
super.setUp();
|
||||
|
||||
// ensure we're using the default configuration, not simple config
|
||||
XmlConfigurationProvider configurationProvider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider configurationProvider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(configurationProvider);
|
||||
loadConfigurationProviders(configurationProvider);
|
||||
}
|
||||
@@ -481,8 +483,8 @@ public class DefaultActionInvocationTest extends XWorkTestCase {
|
||||
|
||||
private class SimpleActionEventListener implements ActionEventListener {
|
||||
|
||||
private String name;
|
||||
private String result;
|
||||
private final String name;
|
||||
private final String result;
|
||||
|
||||
SimpleActionEventListener(String name, String result) {
|
||||
|
||||
@@ -492,7 +494,7 @@ public class DefaultActionInvocationTest extends XWorkTestCase {
|
||||
|
||||
@Override
|
||||
public Object prepare(Object action, ValueStack stack) {
|
||||
((SimpleAction)action).setName(name);
|
||||
((SimpleAction) action).setName(name);
|
||||
return action;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2;
|
||||
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.mock.MockActionInvocation;
|
||||
import org.apache.struts2.StrutsInternalTestCase;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.junit.Test;
|
||||
|
||||
public class DefaultActionProxyTest extends StrutsInternalTestCase {
|
||||
@@ -28,7 +28,7 @@ public class DefaultActionProxyTest extends StrutsInternalTestCase {
|
||||
@Test
|
||||
public void testThorwExceptionOnNotAllowedMethod() throws Exception {
|
||||
final String filename = "com/opensymphony/xwork2/config/providers/xwork-test-allowed-methods.xml";
|
||||
loadConfigurationProviders(new XmlConfigurationProvider(filename));
|
||||
loadConfigurationProviders(new StrutsXmlConfigurationProvider(filename));
|
||||
DefaultActionProxy dap = new DefaultActionProxy(new MockActionInvocation(), "strict", "Default", "notAllowed", true, true);
|
||||
container.inject(dap);
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package com.opensymphony.xwork2;
|
||||
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
/**
|
||||
* <code>WildCardResultTest</code>
|
||||
@@ -33,7 +34,7 @@ public class DefaultClasstTest extends XWorkTestCase {
|
||||
super.setUp();
|
||||
|
||||
// ensure we're using the default configuration, not simple config
|
||||
XmlConfigurationProvider configurationProvider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider configurationProvider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(configurationProvider);
|
||||
loadConfigurationProviders(configurationProvider);
|
||||
}
|
||||
@@ -41,20 +42,20 @@ public class DefaultClasstTest extends XWorkTestCase {
|
||||
public void testWildCardEvaluation() throws Exception {
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy("Abstract-crud", "edit", null, null);
|
||||
assertEquals("com.opensymphony.xwork2.SimpleAction", proxy.getConfig().getClassName());
|
||||
|
||||
|
||||
proxy = actionProxyFactory.createActionProxy("/example", "edit", null, null);
|
||||
assertEquals("com.opensymphony.xwork2.ModelDrivenAction", proxy.getConfig().getClassName());
|
||||
|
||||
|
||||
|
||||
proxy = actionProxyFactory.createActionProxy("/example2", "override", null, null);
|
||||
assertEquals("com.opensymphony.xwork2.ModelDrivenAction", proxy.getConfig().getClassName());
|
||||
|
||||
|
||||
proxy = actionProxyFactory.createActionProxy("/example2/subItem", "save", null, null);
|
||||
assertEquals("com.opensymphony.xwork2.ModelDrivenAction", proxy.getConfig().getClassName());
|
||||
|
||||
|
||||
proxy = actionProxyFactory.createActionProxy("/example2", "list", null, null);
|
||||
assertEquals("com.opensymphony.xwork2.ModelDrivenAction", proxy.getConfig().getClassName());
|
||||
|
||||
|
||||
proxy = actionProxyFactory.createActionProxy("/example3", "list", null, null);
|
||||
assertEquals("com.opensymphony.xwork2.SimpleAction", proxy.getConfig().getClassName());
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.opensymphony.xwork2.config.providers.MockConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.ValueStackFactory;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -30,7 +31,7 @@ import java.util.Locale;
|
||||
* LocaleAwareTest
|
||||
*
|
||||
* @author Jason Carreira
|
||||
* Created Feb 10, 2003 6:13:13 PM
|
||||
* Created Feb 10, 2003 6:13:13 PM
|
||||
*/
|
||||
public class LocaleAwareTest extends XWorkTestCase {
|
||||
|
||||
@@ -63,7 +64,7 @@ public class LocaleAwareTest extends XWorkTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
XmlConfigurationProvider configurationProvider = new XmlConfigurationProvider("xwork-test-beans.xml");
|
||||
XmlConfigurationProvider configurationProvider = new StrutsXmlConfigurationProvider("xwork-test-beans.xml");
|
||||
container.inject(configurationProvider);
|
||||
loadConfigurationProviders(configurationProvider, new MockConfigurationProvider());
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package com.opensymphony.xwork2;
|
||||
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -31,22 +32,22 @@ public class ProxyInvocationTest extends XWorkTestCase {
|
||||
/**
|
||||
* Sets a ProxyObjectFactory as ObjectFactory (so the FooAction will always be retrieved
|
||||
* as a FooProxy), and it tries to call invokeAction on the TestActionInvocation.
|
||||
*
|
||||
* It should fail, because the Method got from the action (actually a FooProxy)
|
||||
* will be executed on the InvocationHandler of the action (so, in the action itself).
|
||||
* <p>
|
||||
* It should fail, because the Method got from the action (actually a FooProxy)
|
||||
* will be executed on the InvocationHandler of the action (so, in the action itself).
|
||||
*/
|
||||
public void testProxyInvocation() throws Exception {
|
||||
|
||||
ActionProxy proxy = actionProxyFactory
|
||||
.createActionProxy("", "ProxyInvocation", null, createDummyContext());
|
||||
ActionInvocation invocation = proxy.getInvocation();
|
||||
|
||||
|
||||
String result = invocation.invokeActionOnly();
|
||||
assertEquals("proxyResult", result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Needed for the creation of the action proxy
|
||||
*/
|
||||
private Map<String, Object> createDummyContext() {
|
||||
@@ -62,7 +63,7 @@ public class ProxyInvocationTest extends XWorkTestCase {
|
||||
super.setUp();
|
||||
|
||||
// ensure we're using the default configuration, not simple config
|
||||
XmlConfigurationProvider configurationProvider = new XmlConfigurationProvider("xwork-proxyinvoke.xml");
|
||||
XmlConfigurationProvider configurationProvider = new StrutsXmlConfigurationProvider("xwork-proxyinvoke.xml");
|
||||
container.inject(configurationProvider);
|
||||
loadConfigurationProviders(configurationProvider);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ package com.opensymphony.xwork2;
|
||||
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.mock.MockResult;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
/**
|
||||
* <code>WildCardResultTest</code>
|
||||
@@ -34,7 +35,7 @@ public class WildCardResultTest extends XWorkTestCase {
|
||||
super.setUp();
|
||||
|
||||
// ensure we're using the default configuration, not simple config
|
||||
XmlConfigurationProvider configurationProvider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider configurationProvider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(configurationProvider);
|
||||
loadConfigurationProviders(configurationProvider);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.mockobjects.dynamic.C;
|
||||
import com.mockobjects.dynamic.Mock;
|
||||
import com.opensymphony.xwork2.FileManagerFactory;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
|
||||
import com.opensymphony.xwork2.conversion.TypeConverterHolder;
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
import com.opensymphony.xwork2.inject.ContainerBuilder;
|
||||
@@ -168,7 +168,7 @@ public class ConfigurationManagerTest extends XWorkTestCase {
|
||||
configProviderMock.matchAndReturn("equals", C.ANY_ARGS, false);
|
||||
|
||||
ConfigurationProvider mockProvider = (ConfigurationProvider) configProviderMock.proxy();
|
||||
configurationManager.addContainerProvider(new XWorkConfigurationProvider());
|
||||
configurationManager.addContainerProvider(new StrutsDefaultConfigurationProvider());
|
||||
configurationManager.addContainerProvider(mockProvider);
|
||||
|
||||
//the first time it always inits
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.opensymphony.xwork2.inject.ContainerBuilder;
|
||||
import com.opensymphony.xwork2.mock.MockInterceptor;
|
||||
import com.opensymphony.xwork2.test.StubConfigurationProvider;
|
||||
import com.opensymphony.xwork2.util.location.LocatableProperties;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -86,20 +87,20 @@ public class ConfigurationTest extends XWorkTestCase {
|
||||
// check inheritance from Default
|
||||
assertNotNull(configuration.getActionConfig("includeTest", "Foo"));
|
||||
}
|
||||
|
||||
|
||||
public void testWildcardName() {
|
||||
RuntimeConfiguration configuration = configurationManager.getConfiguration().getRuntimeConfiguration();
|
||||
|
||||
ActionConfig config = configuration.getActionConfig("", "WildCard/Simple/input");
|
||||
|
||||
|
||||
assertNotNull(config);
|
||||
assertTrue("Wrong class name, "+config.getClassName(),
|
||||
"com.opensymphony.xwork2.SimpleAction".equals(config.getClassName()));
|
||||
assertTrue("Wrong class name, " + config.getClassName(),
|
||||
"com.opensymphony.xwork2.SimpleAction".equals(config.getClassName()));
|
||||
assertTrue("Wrong method name", "input".equals(config.getMethodName()));
|
||||
|
||||
|
||||
Map<String, String> p = config.getParams();
|
||||
assertTrue("Wrong parameter, "+p.get("foo"), "Simple".equals(p.get("foo")));
|
||||
assertTrue("Wrong parameter, "+p.get("bar"), "input".equals(p.get("bar")));
|
||||
assertTrue("Wrong parameter, " + p.get("foo"), "Simple".equals(p.get("foo")));
|
||||
assertTrue("Wrong parameter, " + p.get("bar"), "input".equals(p.get("bar")));
|
||||
}
|
||||
|
||||
public void testWildcardNamespace() {
|
||||
@@ -108,12 +109,12 @@ public class ConfigurationTest extends XWorkTestCase {
|
||||
ActionConfig config = configuration.getActionConfig("/animals/dog", "commandTest");
|
||||
|
||||
assertNotNull(config);
|
||||
assertTrue("Wrong class name, "+config.getClassName(),
|
||||
"com.opensymphony.xwork2.SimpleAction".equals(config.getClassName()));
|
||||
assertTrue("Wrong class name, " + config.getClassName(),
|
||||
"com.opensymphony.xwork2.SimpleAction".equals(config.getClassName()));
|
||||
|
||||
Map<String, String> p = config.getParams();
|
||||
assertTrue("Wrong parameter, "+p.get("0"), "/animals/dog".equals(p.get("0")));
|
||||
assertTrue("Wrong parameter, "+p.get("1"), "dog".equals(p.get("1")));
|
||||
assertTrue("Wrong parameter, " + p.get("0"), "/animals/dog".equals(p.get("0")));
|
||||
assertTrue("Wrong parameter, " + p.get("1"), "dog".equals(p.get("1")));
|
||||
}
|
||||
|
||||
public void testGlobalResults() {
|
||||
@@ -204,11 +205,11 @@ public class ConfigurationTest extends XWorkTestCase {
|
||||
// check that it has configuration from MockConfigurationProvider
|
||||
assertNotNull(configuration.getActionConfig("", MockConfigurationProvider.FOO_ACTION_NAME));
|
||||
}
|
||||
|
||||
|
||||
public void testMultipleContainerProviders() throws Exception {
|
||||
// to start from scratch
|
||||
configurationManager.destroyConfiguration();
|
||||
// to build basic configuration
|
||||
// to build basic configuration
|
||||
configurationManager.getConfiguration();
|
||||
|
||||
Mock mockContainerProvider = new Mock(ContainerProvider.class);
|
||||
@@ -220,7 +221,7 @@ public class ConfigurationTest extends XWorkTestCase {
|
||||
mockContainerProvider.expectAndReturn("needsReload", true);
|
||||
// the order of providers must be changed as just first is checked if reload is needed
|
||||
configurationManager.addContainerProvider((ContainerProvider) mockContainerProvider.proxy());
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(provider);
|
||||
configurationManager.addContainerProvider(provider);
|
||||
|
||||
@@ -231,7 +232,7 @@ public class ConfigurationTest extends XWorkTestCase {
|
||||
e.printStackTrace();
|
||||
fail();
|
||||
}
|
||||
|
||||
|
||||
RuntimeConfiguration configuration = config.getRuntimeConfiguration();
|
||||
|
||||
// check that it has configuration from xml
|
||||
@@ -239,24 +240,25 @@ public class ConfigurationTest extends XWorkTestCase {
|
||||
|
||||
mockContainerProvider.verify();
|
||||
}
|
||||
|
||||
|
||||
public void testInitForPackageProviders() {
|
||||
|
||||
|
||||
loadConfigurationProviders(new StubConfigurationProvider() {
|
||||
@Override
|
||||
public void register(ContainerBuilder builder,
|
||||
LocatableProperties props) throws ConfigurationException {
|
||||
LocatableProperties props) throws ConfigurationException {
|
||||
builder.factory(PackageProvider.class, "foo", MyPackageProvider.class);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
assertEquals(configuration, MyPackageProvider.getConfiguration());
|
||||
}
|
||||
|
||||
|
||||
public void testInitOnceForConfigurationProviders() {
|
||||
|
||||
|
||||
loadConfigurationProviders(new StubConfigurationProvider() {
|
||||
boolean called = false;
|
||||
|
||||
@Override
|
||||
public void init(Configuration config) {
|
||||
if (called) {
|
||||
@@ -264,7 +266,7 @@ public class ConfigurationTest extends XWorkTestCase {
|
||||
}
|
||||
called = true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void loadPackages() {
|
||||
if (!called) {
|
||||
@@ -300,30 +302,36 @@ public class ConfigurationTest extends XWorkTestCase {
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
// ensure we're using the default configuration, not simple config
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider);
|
||||
}
|
||||
|
||||
public static class MyPackageProvider implements PackageProvider {
|
||||
static Configuration config;
|
||||
public void loadPackages() throws ConfigurationException {}
|
||||
public boolean needsReload() { return config != null; }
|
||||
|
||||
|
||||
public void loadPackages() throws ConfigurationException {
|
||||
}
|
||||
|
||||
public boolean needsReload() {
|
||||
return config != null;
|
||||
}
|
||||
|
||||
public static Configuration getConfiguration() {
|
||||
return config;
|
||||
}
|
||||
|
||||
public void init(Configuration configuration)
|
||||
throws ConfigurationException {
|
||||
throws ConfigurationException {
|
||||
config = configuration;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -21,21 +21,22 @@ package com.opensymphony.xwork2.config.providers;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.ConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.impl.MockConfiguration;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
/**
|
||||
* ConfigurationTestBase
|
||||
*
|
||||
* @author Jason Carreira
|
||||
* Created Jun 9, 2003 7:42:12 AM
|
||||
* Created Jun 9, 2003 7:42:12 AM
|
||||
*/
|
||||
public abstract class ConfigurationTestBase extends XWorkTestCase {
|
||||
|
||||
protected ConfigurationProvider buildConfigurationProvider(final String filename) {
|
||||
configuration = new MockConfiguration();
|
||||
((MockConfiguration)configuration).selfRegister();
|
||||
((MockConfiguration) configuration).selfRegister();
|
||||
container = configuration.getContainer();
|
||||
|
||||
XmlConfigurationProvider prov = new XmlConfigurationProvider(filename, true);
|
||||
XmlConfigurationProvider prov = new StrutsXmlConfigurationProvider(filename);
|
||||
container.inject(prov);
|
||||
prov.init(configuration);
|
||||
prov.loadPackages();
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class XmlConfigurationProviderGlobalResultInheritenceTest extends Configu
|
||||
ConfigurationProvider provider = buildConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-global-result-inheritence.xml");
|
||||
|
||||
ConfigurationManager configurationManager = new ConfigurationManager(Container.DEFAULT_NAME);
|
||||
configurationManager.addContainerProvider(new XWorkConfigurationProvider());
|
||||
configurationManager.addContainerProvider(new StrutsDefaultConfigurationProvider());
|
||||
configurationManager.addContainerProvider(provider);
|
||||
Configuration configuration = configurationManager.getConfiguration();
|
||||
|
||||
|
||||
+3
-3
@@ -19,7 +19,6 @@
|
||||
package com.opensymphony.xwork2.config.providers;
|
||||
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.ConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.ContainerProvider;
|
||||
import com.opensymphony.xwork2.config.RuntimeConfiguration;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
@@ -27,6 +26,7 @@ import com.opensymphony.xwork2.config.entities.InterceptorMapping;
|
||||
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
|
||||
import com.opensymphony.xwork2.util.fs.DefaultFileManager;
|
||||
import com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -39,14 +39,14 @@ public class XmlConfigurationProviderInterceptorParamOverridingTest extends XWor
|
||||
|
||||
public void testInterceptorParamOveriding() throws Exception {
|
||||
DefaultConfiguration conf = new DefaultConfiguration();
|
||||
final XmlConfigurationProvider p = new XmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-interceptor-param-overriding.xml");
|
||||
final XmlConfigurationProvider p = new StrutsXmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-interceptor-param-overriding.xml");
|
||||
DefaultFileManagerFactory factory = new DefaultFileManagerFactory();
|
||||
factory.setContainer(container);
|
||||
factory.setFileManager(new DefaultFileManager());
|
||||
p.setFileManagerFactory(factory);
|
||||
conf.reloadContainer(new ArrayList<ContainerProvider>() {
|
||||
{
|
||||
add(new XWorkConfigurationProvider());
|
||||
add(new StrutsDefaultConfigurationProvider());
|
||||
add(p);
|
||||
}
|
||||
});
|
||||
|
||||
+46
-46
@@ -19,7 +19,6 @@
|
||||
package com.opensymphony.xwork2.config.providers;
|
||||
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.ConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.ContainerProvider;
|
||||
import com.opensymphony.xwork2.config.RuntimeConfiguration;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
@@ -27,6 +26,7 @@ import com.opensymphony.xwork2.config.entities.InterceptorMapping;
|
||||
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
|
||||
import com.opensymphony.xwork2.util.fs.DefaultFileManager;
|
||||
import com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -38,71 +38,71 @@ import java.util.List;
|
||||
* @version $Id$
|
||||
*/
|
||||
public class XmlConfigurationProviderInterceptorStackParamOverridingTest extends XWorkTestCase {
|
||||
|
||||
|
||||
public void testInterceptorStackParamOveriding() throws Exception {
|
||||
DefaultConfiguration conf = new DefaultConfiguration();
|
||||
final XmlConfigurationProvider p = new XmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-interceptor-stack-param-overriding.xml");
|
||||
DefaultConfiguration conf = new DefaultConfiguration();
|
||||
final XmlConfigurationProvider p = new StrutsXmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-interceptor-stack-param-overriding.xml");
|
||||
DefaultFileManagerFactory factory = new DefaultFileManagerFactory();
|
||||
factory.setContainer(container);
|
||||
factory.setFileManager(new DefaultFileManager());
|
||||
p.setFileManagerFactory(factory);
|
||||
configurationManager.addContainerProvider(p);
|
||||
configurationManager.addContainerProvider(p);
|
||||
conf.reloadContainer(new ArrayList<ContainerProvider>() {
|
||||
{
|
||||
add(new XWorkConfigurationProvider());
|
||||
add(p);
|
||||
}
|
||||
});
|
||||
{
|
||||
add(new StrutsDefaultConfigurationProvider());
|
||||
add(p);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
RuntimeConfiguration rtConf = conf.getRuntimeConfiguration();
|
||||
RuntimeConfiguration rtConf = conf.getRuntimeConfiguration();
|
||||
|
||||
ActionConfig actionOne = rtConf.getActionConfig("", "actionOne");
|
||||
ActionConfig actionTwo = rtConf.getActionConfig("", "actionTwo");
|
||||
ActionConfig actionOne = rtConf.getActionConfig("", "actionOne");
|
||||
ActionConfig actionTwo = rtConf.getActionConfig("", "actionTwo");
|
||||
|
||||
List actionOneInterceptors = actionOne.getInterceptors();
|
||||
List actionTwoInterceptors = actionTwo.getInterceptors();
|
||||
List actionOneInterceptors = actionOne.getInterceptors();
|
||||
List actionTwoInterceptors = actionTwo.getInterceptors();
|
||||
|
||||
assertNotNull(actionOne);
|
||||
assertNotNull(actionTwo);
|
||||
assertNotNull(actionOneInterceptors);
|
||||
assertNotNull(actionTwoInterceptors);
|
||||
assertEquals(actionOneInterceptors.size(), 3);
|
||||
assertEquals(actionTwoInterceptors.size(), 3);
|
||||
assertNotNull(actionOne);
|
||||
assertNotNull(actionTwo);
|
||||
assertNotNull(actionOneInterceptors);
|
||||
assertNotNull(actionTwoInterceptors);
|
||||
assertEquals(actionOneInterceptors.size(), 3);
|
||||
assertEquals(actionTwoInterceptors.size(), 3);
|
||||
|
||||
InterceptorMapping actionOneInterceptorMapping1 = (InterceptorMapping) actionOneInterceptors.get(0);
|
||||
InterceptorMapping actionOneInterceptorMapping2 = (InterceptorMapping) actionOneInterceptors.get(1);
|
||||
InterceptorMapping actionOneInterceptorMapping3 = (InterceptorMapping) actionOneInterceptors.get(2);
|
||||
InterceptorMapping actionTwoInterceptorMapping1 = (InterceptorMapping) actionTwoInterceptors.get(0);
|
||||
InterceptorMapping actionTwoInterceptorMapping2 = (InterceptorMapping) actionTwoInterceptors.get(1);
|
||||
InterceptorMapping actionTwoInterceptorMapping3 = (InterceptorMapping) actionTwoInterceptors.get(2);
|
||||
InterceptorMapping actionOneInterceptorMapping1 = (InterceptorMapping) actionOneInterceptors.get(0);
|
||||
InterceptorMapping actionOneInterceptorMapping2 = (InterceptorMapping) actionOneInterceptors.get(1);
|
||||
InterceptorMapping actionOneInterceptorMapping3 = (InterceptorMapping) actionOneInterceptors.get(2);
|
||||
InterceptorMapping actionTwoInterceptorMapping1 = (InterceptorMapping) actionTwoInterceptors.get(0);
|
||||
InterceptorMapping actionTwoInterceptorMapping2 = (InterceptorMapping) actionTwoInterceptors.get(1);
|
||||
InterceptorMapping actionTwoInterceptorMapping3 = (InterceptorMapping) actionTwoInterceptors.get(2);
|
||||
|
||||
assertNotNull(actionOneInterceptorMapping1);
|
||||
assertNotNull(actionOneInterceptorMapping2);
|
||||
assertNotNull(actionOneInterceptorMapping3);
|
||||
assertNotNull(actionTwoInterceptorMapping1);
|
||||
assertNotNull(actionTwoInterceptorMapping2);
|
||||
assertNotNull(actionTwoInterceptorMapping3);
|
||||
assertNotNull(actionOneInterceptorMapping1);
|
||||
assertNotNull(actionOneInterceptorMapping2);
|
||||
assertNotNull(actionOneInterceptorMapping3);
|
||||
assertNotNull(actionTwoInterceptorMapping1);
|
||||
assertNotNull(actionTwoInterceptorMapping2);
|
||||
assertNotNull(actionTwoInterceptorMapping3);
|
||||
|
||||
|
||||
assertEquals(((InterceptorForTestPurpose)actionOneInterceptorMapping1.getInterceptor()).getParamOne(), "i1p1");
|
||||
assertEquals(((InterceptorForTestPurpose)actionOneInterceptorMapping1.getInterceptor()).getParamTwo(), "i1p2");
|
||||
assertEquals(((InterceptorForTestPurpose)actionOneInterceptorMapping2.getInterceptor()).getParamOne(), "i2p1");
|
||||
assertEquals(((InterceptorForTestPurpose)actionOneInterceptorMapping2.getInterceptor()).getParamTwo(), null);
|
||||
assertEquals(((InterceptorForTestPurpose)actionOneInterceptorMapping3.getInterceptor()).getParamOne(), null);
|
||||
assertEquals(((InterceptorForTestPurpose)actionOneInterceptorMapping3.getInterceptor()).getParamTwo(), null);
|
||||
assertEquals(((InterceptorForTestPurpose) actionOneInterceptorMapping1.getInterceptor()).getParamOne(), "i1p1");
|
||||
assertEquals(((InterceptorForTestPurpose) actionOneInterceptorMapping1.getInterceptor()).getParamTwo(), "i1p2");
|
||||
assertEquals(((InterceptorForTestPurpose) actionOneInterceptorMapping2.getInterceptor()).getParamOne(), "i2p1");
|
||||
assertEquals(((InterceptorForTestPurpose) actionOneInterceptorMapping2.getInterceptor()).getParamTwo(), null);
|
||||
assertEquals(((InterceptorForTestPurpose) actionOneInterceptorMapping3.getInterceptor()).getParamOne(), null);
|
||||
assertEquals(((InterceptorForTestPurpose) actionOneInterceptorMapping3.getInterceptor()).getParamTwo(), null);
|
||||
|
||||
assertEquals(((InterceptorForTestPurpose)actionTwoInterceptorMapping1.getInterceptor()).getParamOne(), null);
|
||||
assertEquals(((InterceptorForTestPurpose)actionTwoInterceptorMapping1.getInterceptor()).getParamTwo(), null);
|
||||
assertEquals(((InterceptorForTestPurpose)actionTwoInterceptorMapping2.getInterceptor()).getParamOne(), null);
|
||||
assertEquals(((InterceptorForTestPurpose)actionTwoInterceptorMapping2.getInterceptor()).getParamTwo(), "i2p2");
|
||||
assertEquals(((InterceptorForTestPurpose)actionTwoInterceptorMapping3.getInterceptor()).getParamOne(), "i3p1");
|
||||
assertEquals(((InterceptorForTestPurpose)actionTwoInterceptorMapping3.getInterceptor()).getParamTwo(), "i3p2");
|
||||
assertEquals(((InterceptorForTestPurpose) actionTwoInterceptorMapping1.getInterceptor()).getParamOne(), null);
|
||||
assertEquals(((InterceptorForTestPurpose) actionTwoInterceptorMapping1.getInterceptor()).getParamTwo(), null);
|
||||
assertEquals(((InterceptorForTestPurpose) actionTwoInterceptorMapping2.getInterceptor()).getParamOne(), null);
|
||||
assertEquals(((InterceptorForTestPurpose) actionTwoInterceptorMapping2.getInterceptor()).getParamTwo(), "i2p2");
|
||||
assertEquals(((InterceptorForTestPurpose) actionTwoInterceptorMapping3.getInterceptor()).getParamOne(), "i3p1");
|
||||
assertEquals(((InterceptorForTestPurpose) actionTwoInterceptorMapping3.getInterceptor()).getParamTwo(), "i3p2");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
configurationManager.clearContainerProviders();
|
||||
configurationManager.clearContainerProviders();
|
||||
}
|
||||
}
|
||||
|
||||
+19
-14
@@ -23,9 +23,14 @@ import com.opensymphony.xwork2.SimpleAction;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.config.ConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.RuntimeConfiguration;
|
||||
import com.opensymphony.xwork2.config.entities.*;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.config.entities.InterceptorConfig;
|
||||
import com.opensymphony.xwork2.config.entities.InterceptorMapping;
|
||||
import com.opensymphony.xwork2.config.entities.InterceptorStackConfig;
|
||||
import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.interceptor.LoggingInterceptor;
|
||||
import com.opensymphony.xwork2.mock.MockInterceptor;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.interceptor.NoOpInterceptor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -46,7 +51,7 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
|
||||
InterceptorConfig mockInterceptor = new InterceptorConfig.Builder("mock", MockInterceptor.class.getName()).build();
|
||||
InterceptorConfig noopInterceptor = new InterceptorConfig.Builder("noop", NoOpInterceptor.class.getName()).build();
|
||||
ObjectFactory objectFactory;
|
||||
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
@@ -68,16 +73,16 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
|
||||
|
||||
// the default interceptor stack
|
||||
InterceptorStackConfig defaultStack = new InterceptorStackConfig.Builder("defaultStack")
|
||||
.addInterceptor(new InterceptorMapping("noop", objectFactory.buildInterceptor(noopInterceptor, new HashMap<String, String>())))
|
||||
.addInterceptor(new InterceptorMapping("test", objectFactory.buildInterceptor(mockInterceptor, params)))
|
||||
.build();
|
||||
.addInterceptor(new InterceptorMapping("noop", objectFactory.buildInterceptor(noopInterceptor, new HashMap<String, String>())))
|
||||
.addInterceptor(new InterceptorMapping("test", objectFactory.buildInterceptor(mockInterceptor, params)))
|
||||
.build();
|
||||
|
||||
// the derivative interceptor stack
|
||||
InterceptorStackConfig derivativeStack = new InterceptorStackConfig.Builder("derivativeStack")
|
||||
.addInterceptor(new InterceptorMapping("noop", objectFactory.buildInterceptor(noopInterceptor, new HashMap<String, String>())))
|
||||
.addInterceptor(new InterceptorMapping("test", objectFactory.buildInterceptor(mockInterceptor, params)))
|
||||
.addInterceptor(new InterceptorMapping("logging", objectFactory.buildInterceptor(loggingInterceptor, new HashMap<String, String>())))
|
||||
.build();
|
||||
.addInterceptor(new InterceptorMapping("noop", objectFactory.buildInterceptor(noopInterceptor, new HashMap<String, String>())))
|
||||
.addInterceptor(new InterceptorMapping("test", objectFactory.buildInterceptor(mockInterceptor, params)))
|
||||
.addInterceptor(new InterceptorMapping("logging", objectFactory.buildInterceptor(loggingInterceptor, new HashMap<String, String>())))
|
||||
.build();
|
||||
|
||||
// execute the configuration
|
||||
provider.init(configuration);
|
||||
@@ -100,7 +105,7 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
|
||||
}
|
||||
|
||||
public void testInterceptorDefaultRefs() throws ConfigurationException {
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-interceptor-defaultref.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-interceptor-defaultref.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider);
|
||||
|
||||
@@ -141,7 +146,7 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
|
||||
}
|
||||
|
||||
public void testInterceptorInheritance() throws ConfigurationException {
|
||||
|
||||
|
||||
// expectations - the inherited interceptor stack
|
||||
InterceptorStackConfig inheritedStack = new InterceptorStackConfig.Builder("subDefaultStack")
|
||||
.addInterceptor(new InterceptorMapping("noop", objectFactory.buildInterceptor(noopInterceptor, new HashMap<String, String>())))
|
||||
@@ -160,9 +165,9 @@ public class XmlConfigurationProviderInterceptorsTest extends ConfigurationTestB
|
||||
|
||||
// expectations - the inherited interceptor stack
|
||||
inheritedStack = new InterceptorStackConfig.Builder("subSubDefaultStack")
|
||||
.addInterceptor(new InterceptorMapping("noop", objectFactory.buildInterceptor(noopInterceptor, new HashMap<String, String>())))
|
||||
.addInterceptor(new InterceptorMapping("noop", objectFactory.buildInterceptor(noopInterceptor, new HashMap<String, String>())))
|
||||
.build();
|
||||
.addInterceptor(new InterceptorMapping("noop", objectFactory.buildInterceptor(noopInterceptor, new HashMap<String, String>())))
|
||||
.addInterceptor(new InterceptorMapping("noop", objectFactory.buildInterceptor(noopInterceptor, new HashMap<String, String>())))
|
||||
.build();
|
||||
|
||||
PackageConfig subSubPkg = configuration.getPackageConfig("subSubPackage");
|
||||
assertEquals(1, subSubPkg.getInterceptorConfigs().size());
|
||||
|
||||
+82
-79
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2.config.providers;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.FileManagerFactory;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.config.ConfigurationProvider;
|
||||
@@ -27,7 +28,17 @@ import com.opensymphony.xwork2.config.entities.ResultConfig;
|
||||
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
|
||||
import com.opensymphony.xwork2.config.impl.MockConfiguration;
|
||||
import com.opensymphony.xwork2.util.ClassLoaderUtil;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.result.ServletDispatcherResult;
|
||||
import org.w3c.dom.Attr;
|
||||
import org.w3c.dom.DOMException;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.w3c.dom.TypeInfo;
|
||||
import org.w3c.dom.UserDataHandler;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -42,15 +53,6 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.apache.struts2.result.ServletDispatcherResult;
|
||||
import org.w3c.dom.Attr;
|
||||
import org.w3c.dom.DOMException;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.w3c.dom.TypeInfo;
|
||||
import org.w3c.dom.UserDataHandler;
|
||||
|
||||
|
||||
public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
@@ -60,7 +62,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
((MockConfiguration) configuration).selfRegister();
|
||||
container = configuration.getContainer();
|
||||
|
||||
XmlConfigurationProvider prov = new XmlConfigurationProvider("xwork-test-load-order.xml", true) {
|
||||
XmlConfigurationProvider prov = new StrutsXmlConfigurationProvider("xwork-test-load-order.xml") {
|
||||
@Override
|
||||
protected Iterator<URL> getConfigurationUrls(String fileName) throws IOException {
|
||||
List<URL> urls = new ArrayList<>();
|
||||
@@ -83,7 +85,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
|
||||
public static final long FILE_TS_WAIT_IN_MS = 3600000;
|
||||
|
||||
private static void changeFileTime(File f) throws Exception {
|
||||
private static void changeFileTime(String filename, File f) throws Exception {
|
||||
final long orig = f.lastModified();
|
||||
final long maxwait = orig + FILE_TS_WAIT_IN_MS;
|
||||
long curr;
|
||||
@@ -91,11 +93,12 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
Thread.sleep(500);
|
||||
assertTrue("Waited more than " + FILE_TS_WAIT_IN_MS + " ms to update timestamp on file: " + f, maxwait > curr);
|
||||
}
|
||||
ActionContext.getContext().with("configurationReload-" + filename, null);
|
||||
}
|
||||
|
||||
public void testNeedsReload() throws Exception {
|
||||
final String filename = "com/opensymphony/xwork2/config/providers/xwork-test-actions.xml";
|
||||
ConfigurationProvider provider = new XmlConfigurationProvider(filename, true);
|
||||
ConfigurationProvider provider = new StrutsXmlConfigurationProvider(filename);
|
||||
container.inject(provider);
|
||||
provider.init(configuration);
|
||||
provider.loadPackages();
|
||||
@@ -105,14 +108,14 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
|
||||
File file = new File(getClass().getResource("/" + filename).toURI());
|
||||
assertTrue("not exists: " + file.toString(), file.exists());
|
||||
changeFileTime(file);
|
||||
changeFileTime(filename, file);
|
||||
|
||||
assertTrue(provider.needsReload());
|
||||
}
|
||||
|
||||
public void testReload() throws Exception {
|
||||
final String filename = "com/opensymphony/xwork2/config/providers/xwork-test-reload.xml";
|
||||
ConfigurationProvider provider = new XmlConfigurationProvider(filename, true);
|
||||
ConfigurationProvider provider = new StrutsXmlConfigurationProvider(filename);
|
||||
loadConfigurationProviders(provider);
|
||||
|
||||
assertFalse(provider.needsReload()); // Revision exists and timestamp didn't change
|
||||
@@ -123,7 +126,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
Path configPath = Paths.get(file.getAbsolutePath());
|
||||
String content = new String(Files.readAllBytes(configPath));
|
||||
content = content.replaceAll("<constant name=\"struts.configuration.xml.reload\" value=\"true\" />",
|
||||
"<constant name=\"struts.configuration.xml.reload\" value=\"false\" />");
|
||||
"<constant name=\"struts.configuration.xml.reload\" value=\"false\" />");
|
||||
Files.write(configPath, content.getBytes()); // user demand: stop reloading configs
|
||||
|
||||
try {
|
||||
@@ -131,11 +134,11 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
|
||||
configurationManager.reload();
|
||||
|
||||
changeFileTime(file);
|
||||
changeFileTime(filename, file);
|
||||
assertFalse(provider.needsReload()); // user already has stopped reloading configs
|
||||
} finally {
|
||||
content = content.replaceAll("<constant name=\"struts.configuration.xml.reload\" value=\"false\" />",
|
||||
"<constant name=\"struts.configuration.xml.reload\" value=\"true\" />");
|
||||
"<constant name=\"struts.configuration.xml.reload\" value=\"true\" />");
|
||||
Files.write(configPath, content.getBytes());
|
||||
}
|
||||
}
|
||||
@@ -143,7 +146,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
public void testNeedsReloadNotReloadingConfigs() throws Exception {
|
||||
final String filename = "com/opensymphony/xwork2/config/providers/xwork-test-actions.xml";
|
||||
buildConfigurationProvider(filename);
|
||||
ConfigurationProvider provider = new XmlConfigurationProvider(filename, true);
|
||||
ConfigurationProvider provider = new StrutsXmlConfigurationProvider(filename);
|
||||
container.getInstance(FileManagerFactory.class).getFileManager().setReloadingConfigs(false);
|
||||
container.inject(provider);
|
||||
provider.init(configuration);
|
||||
@@ -153,7 +156,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
|
||||
File file = new File(getClass().getResource("/" + filename).toURI());
|
||||
assertTrue("not exists: " + file.toString(), file.exists());
|
||||
changeFileTime(file);
|
||||
changeFileTime(filename, file);
|
||||
|
||||
assertFalse(provider.needsReload());
|
||||
}
|
||||
@@ -210,7 +213,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
}
|
||||
|
||||
public void testGuessResultType() {
|
||||
XmlConfigurationProvider prov = new XmlConfigurationProvider();
|
||||
XmlConfigurationProvider prov = new StrutsXmlConfigurationProvider("xwork.xml");
|
||||
|
||||
assertEquals(null, prov.guessResultType(null));
|
||||
assertEquals("foo", prov.guessResultType("foo"));
|
||||
@@ -221,7 +224,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
|
||||
public void testEmptySpaces() throws Exception {
|
||||
final String filename = "com/opensymphony/xwork2/config/providers/xwork- test.xml";
|
||||
ConfigurationProvider provider = new XmlConfigurationProvider(filename, true);
|
||||
ConfigurationProvider provider = new StrutsXmlConfigurationProvider(filename);
|
||||
container.inject(provider);
|
||||
provider.init(configuration);
|
||||
provider.loadPackages();
|
||||
@@ -234,7 +237,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
File file = new File(uri);
|
||||
|
||||
assertTrue(file.exists());
|
||||
changeFileTime(file);
|
||||
changeFileTime(filename, file);
|
||||
|
||||
assertTrue(provider.needsReload());
|
||||
}
|
||||
@@ -242,7 +245,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
public void testEmptySpacesNotReloadingConfigs() throws Exception {
|
||||
final String filename = "com/opensymphony/xwork2/config/providers/xwork- test.xml";
|
||||
buildConfigurationProvider(filename);
|
||||
ConfigurationProvider provider = new XmlConfigurationProvider(filename, true);
|
||||
ConfigurationProvider provider = new StrutsXmlConfigurationProvider(filename);
|
||||
container.getInstance(FileManagerFactory.class).getFileManager().setReloadingConfigs(false);
|
||||
container.inject(provider);
|
||||
provider.init(configuration);
|
||||
@@ -255,7 +258,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
File file = new File(uri);
|
||||
|
||||
assertTrue(file.exists());
|
||||
changeFileTime(file);
|
||||
changeFileTime(filename, file);
|
||||
|
||||
assertFalse(provider.needsReload());
|
||||
}
|
||||
@@ -287,7 +290,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
File file = new File(jar);
|
||||
|
||||
assertTrue("File [" + file + "] doesn't exist!", file.exists());
|
||||
changeFileTime(file);
|
||||
changeFileTime(jar, file);
|
||||
|
||||
assertFalse(provider.needsReload());
|
||||
}
|
||||
@@ -311,8 +314,8 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
/**
|
||||
* Test buildAllowedMethods() to ensure consistent results for processing
|
||||
* <allowed-methods/> in <action/> XML configuration elements.
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public void testBuildAllowedMethods() throws Exception {
|
||||
// Test introduced with WW-5029 fix.
|
||||
@@ -335,20 +338,20 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
NodeList mockNodeListSingleChild = new MockNodeList(singleStringList);
|
||||
NodeList mockNodeListMultipleChild = new MockNodeList(multipleStringList);
|
||||
Element mockSingleChildAllowedMethodsElement = new MockElement("allowed-methods", fakeBodyString,
|
||||
"allowed-methods", fakeBodyString, Node.TEXT_NODE, mockNodeListSingleChild, null);
|
||||
"allowed-methods", fakeBodyString, Node.TEXT_NODE, mockNodeListSingleChild, null);
|
||||
Element mockMultipleChildAllowedMethodsElement = new MockElement("allowed-methods", fakeBodyString,
|
||||
"allowed-methods", fakeBodyString, Node.TEXT_NODE, mockNodeListMultipleChild, null);
|
||||
"allowed-methods", fakeBodyString, Node.TEXT_NODE, mockNodeListMultipleChild, null);
|
||||
MockNodeList mockActionElementChildrenSingle = new MockNodeList();
|
||||
mockActionElementChildrenSingle.addToNodeList(mockSingleChildAllowedMethodsElement);
|
||||
MockNodeList mockActionElementChildrenMultiple = new MockNodeList();
|
||||
mockActionElementChildrenMultiple.addToNodeList(mockMultipleChildAllowedMethodsElement);
|
||||
Element mockActionElementSingle = new MockElement("action", "fakeBody", "action", "fakeValue",
|
||||
Node.TEXT_NODE, mockActionElementChildrenSingle, null);
|
||||
Node.TEXT_NODE, mockActionElementChildrenSingle, null);
|
||||
Element mockActionElementMultiple = new MockElement("action", "fakeBody", "action", "fakeValue",
|
||||
Node.TEXT_NODE, mockActionElementChildrenMultiple, null);
|
||||
Node.TEXT_NODE, mockActionElementChildrenMultiple, null);
|
||||
// Attempt the method using both types of Elements (single child and multiple child) and confirm
|
||||
// the result is the same for both. Also confirm the results are as expected.
|
||||
XmlConfigurationProvider prov = new XmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork- test.xml", false);
|
||||
XmlConfigurationProvider prov = new StrutsXmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork- test.xml");
|
||||
Set<String> singleChildResult = prov.buildAllowedMethods(mockActionElementSingle, testPackageConfigBuilder);
|
||||
Set<String> multipleChildResult = prov.buildAllowedMethods(mockActionElementMultiple, testPackageConfigBuilder);
|
||||
assertNotNull("singleChildResult is null ?", singleChildResult);
|
||||
@@ -365,8 +368,8 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
/**
|
||||
* Test loadGlobalAllowedMethods() to ensure consistent results for processing
|
||||
* <global-allowed-methods/> in <package/> XML configuration elements.
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public void testLoadGlobalAllowedMethods() throws Exception {
|
||||
// Test introduced with WW-5029 fix.
|
||||
@@ -389,19 +392,19 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
NodeList mockNodeListSingleChild = new MockNodeList(singleStringList);
|
||||
NodeList mockNodeListMultipleChild = new MockNodeList(multipleStringList);
|
||||
Element mockSingleChildAllowedMethodsElement = new MockElement("global-allowed-methods", fakeBodyString,
|
||||
"global-allowed-methods", fakeBodyString, Node.TEXT_NODE, mockNodeListSingleChild, null);
|
||||
"global-allowed-methods", fakeBodyString, Node.TEXT_NODE, mockNodeListSingleChild, null);
|
||||
Element mockMultipleChildAllowedMethodsElement = new MockElement("global-allowed-methods", fakeBodyString,
|
||||
"global-allowed-methods", fakeBodyString, Node.TEXT_NODE, mockNodeListMultipleChild, null);
|
||||
"global-allowed-methods", fakeBodyString, Node.TEXT_NODE, mockNodeListMultipleChild, null);
|
||||
MockNodeList mockPackageElementChildrenSingle = new MockNodeList();
|
||||
mockPackageElementChildrenSingle.addToNodeList(mockSingleChildAllowedMethodsElement);
|
||||
MockNodeList mockPackageElementChildrenMultiple = new MockNodeList();
|
||||
mockPackageElementChildrenMultiple.addToNodeList(mockMultipleChildAllowedMethodsElement);
|
||||
Element mockPackageElementSingle = new MockElement("package", "fakeBody", "package", "fakeValue",
|
||||
Node.TEXT_NODE, mockPackageElementChildrenSingle, null);
|
||||
Node.TEXT_NODE, mockPackageElementChildrenSingle, null);
|
||||
Element mockPackageElementMultiple = new MockElement("package", "fakeBody", "package", "fakeValue",
|
||||
Node.TEXT_NODE, mockPackageElementChildrenMultiple, null);
|
||||
Node.TEXT_NODE, mockPackageElementChildrenMultiple, null);
|
||||
// Attempt the method using the single child Element and confirm the result is as expected.
|
||||
XmlConfigurationProvider prov = new XmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork- test.xml", false);
|
||||
XmlConfigurationProvider prov = new StrutsXmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork- test.xml");
|
||||
prov.loadGlobalAllowedMethods(testPackageConfigBuilder, mockPackageElementSingle);
|
||||
Set<String> currentGlobalResult = testPackageConfigBuilder.getGlobalAllowedMethods();
|
||||
assertNotNull("currentGlobalResult is null ?", currentGlobalResult);
|
||||
@@ -428,8 +431,8 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
/**
|
||||
* Test buildResults() to ensure consistent results for processing
|
||||
* <result/> in <action/> XML configuration elements.
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public void testBuildResults() throws Exception {
|
||||
// Set up test using two mock DOM Elements:
|
||||
@@ -443,7 +446,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
final String fakeBodyString2 = "/SomePath2/SomePath2/SomePath2/SomeJSP2.jsp";
|
||||
final String resultParam = "nonNullDefaultParam";
|
||||
PackageConfig.Builder testPackageConfigBuilder = new PackageConfig.Builder("resultsPackage");
|
||||
ResultTypeConfig.Builder resultTypeConfigBuilder = new ResultTypeConfig.Builder("dispatcher", (String) ServletDispatcherResult.class.getName());
|
||||
ResultTypeConfig.Builder resultTypeConfigBuilder = new ResultTypeConfig.Builder("dispatcher", ServletDispatcherResult.class.getName());
|
||||
resultTypeConfigBuilder.defaultResultParam(resultParam);
|
||||
ResultTypeConfig resultTypeConfig = resultTypeConfigBuilder.build();
|
||||
testPackageConfigBuilder.addResultTypeConfig(resultTypeConfig);
|
||||
@@ -466,19 +469,19 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
NodeList mockNodeListMultipleChild = new MockNodeList(multipleStringList);
|
||||
NodeList mockNodeListMultipleChild2 = new MockNodeList(multipleStringList2);
|
||||
Element mockSingleChildResultElement = new MockElement("result", fakeBodyString,
|
||||
"result", fakeBodyString, Node.TEXT_NODE, mockNodeListSingleChild, null);
|
||||
"result", fakeBodyString, Node.TEXT_NODE, mockNodeListSingleChild, null);
|
||||
mockSingleChildResultElement.setAttribute("name", "input");
|
||||
mockSingleChildResultElement.setAttribute("type", "dispatcher");
|
||||
Element mockSingleChildResultElement2 = new MockElement("result", fakeBodyString2,
|
||||
"result", fakeBodyString2, Node.TEXT_NODE, mockNodeListSingleChild2, null);
|
||||
"result", fakeBodyString2, Node.TEXT_NODE, mockNodeListSingleChild2, null);
|
||||
mockSingleChildResultElement2.setAttribute("name", "success");
|
||||
mockSingleChildResultElement2.setAttribute("type", "dispatcher");
|
||||
Element mockMultipleChildAllowedMethodsElement = new MockElement("result", fakeBodyString,
|
||||
"result", fakeBodyString, Node.TEXT_NODE, mockNodeListMultipleChild, null);
|
||||
"result", fakeBodyString, Node.TEXT_NODE, mockNodeListMultipleChild, null);
|
||||
mockMultipleChildAllowedMethodsElement.setAttribute("name", "input");
|
||||
mockMultipleChildAllowedMethodsElement.setAttribute("type", "dispatcher");
|
||||
Element mockMultipleChildAllowedMethodsElement2 = new MockElement("result", fakeBodyString2,
|
||||
"result", fakeBodyString2, Node.TEXT_NODE, mockNodeListMultipleChild2, null);
|
||||
"result", fakeBodyString2, Node.TEXT_NODE, mockNodeListMultipleChild2, null);
|
||||
mockMultipleChildAllowedMethodsElement2.setAttribute("name", "success");
|
||||
mockMultipleChildAllowedMethodsElement2.setAttribute("type", "dispatcher");
|
||||
MockNodeList mockActionElementChildrenSingle = new MockNodeList();
|
||||
@@ -488,12 +491,12 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
mockActionElementChildrenMultiple.addToNodeList(mockMultipleChildAllowedMethodsElement);
|
||||
mockActionElementChildrenMultiple.addToNodeList(mockMultipleChildAllowedMethodsElement2);
|
||||
Element mockActionElementSingle = new MockElement("action", "fakeBody", "action", "fakeValue",
|
||||
Node.TEXT_NODE, mockActionElementChildrenSingle, null);
|
||||
Node.TEXT_NODE, mockActionElementChildrenSingle, null);
|
||||
Element mockActionElementMultiple = new MockElement("action", "fakeBody", "action", "fakeValue",
|
||||
Node.TEXT_NODE, mockActionElementChildrenMultiple, null);
|
||||
Node.TEXT_NODE, mockActionElementChildrenMultiple, null);
|
||||
// Attempt the method using both types of Elements (single child and multiple child) and confirm
|
||||
// the result is the same for both. Also confirm the results are as expected.
|
||||
XmlConfigurationProvider prov = new XmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork- test.xml", false);
|
||||
XmlConfigurationProvider prov = new StrutsXmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork- test.xml");
|
||||
Map<String, ResultConfig> singleChildResult = prov.buildResults(mockActionElementSingle, testPackageConfigBuilder);
|
||||
Map<String, ResultConfig> multipleChildResult = prov.buildResults(mockActionElementMultiple, testPackageConfigBuilder);
|
||||
assertNotNull("singleChildResult is null ?", singleChildResult);
|
||||
@@ -511,16 +514,16 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
assertNotNull("inputResultParams (multipleChildResult) is null ?", inputResultParams);
|
||||
assertNotNull("successResultParams (multipleChildResult) is null ?", successResultParams);
|
||||
assertEquals("inputResult (multipleChildResult) resultParam value not equal to fakeBodyString ?",
|
||||
fakeBodyString, inputResultParams.get(resultParam));
|
||||
fakeBodyString, inputResultParams.get(resultParam));
|
||||
assertEquals("successResult (multipleChildResult) resultParam value not equal to fakeBodyString2 ?",
|
||||
fakeBodyString2, successResultParams.get(resultParam));
|
||||
fakeBodyString2, successResultParams.get(resultParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test loadGlobalResults() to ensure consistent results for processing
|
||||
* <global-results/> in <package/> XML configuration elements.
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public void testLoadGlobalResults() throws Exception {
|
||||
// Set up test using two mock DOM Elements:
|
||||
@@ -534,7 +537,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
final String fakeBodyString2 = "/SomePath2/SomePath2/SomePath2/SomeJSP2.jsp";
|
||||
final String resultParam = "nonNullDefaultParam";
|
||||
PackageConfig.Builder testPackageConfigBuilder = new PackageConfig.Builder("resultsPackage");
|
||||
ResultTypeConfig.Builder resultTypeConfigBuilder = new ResultTypeConfig.Builder("dispatcher", (String) ServletDispatcherResult.class.getName());
|
||||
ResultTypeConfig.Builder resultTypeConfigBuilder = new ResultTypeConfig.Builder("dispatcher", ServletDispatcherResult.class.getName());
|
||||
resultTypeConfigBuilder.defaultResultParam(resultParam);
|
||||
ResultTypeConfig resultTypeConfig = resultTypeConfigBuilder.build();
|
||||
testPackageConfigBuilder.addResultTypeConfig(resultTypeConfig);
|
||||
@@ -557,19 +560,19 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
NodeList mockNodeListMultipleChild = new MockNodeList(multipleStringList);
|
||||
NodeList mockNodeListMultipleChild2 = new MockNodeList(multipleStringList2);
|
||||
Element mockSingleChildResultElement = new MockElement("result", fakeBodyString,
|
||||
"result", fakeBodyString, Node.TEXT_NODE, mockNodeListSingleChild, null);
|
||||
"result", fakeBodyString, Node.TEXT_NODE, mockNodeListSingleChild, null);
|
||||
mockSingleChildResultElement.setAttribute("name", "input");
|
||||
mockSingleChildResultElement.setAttribute("type", "dispatcher");
|
||||
Element mockSingleChildResultElement2 = new MockElement("result", fakeBodyString2,
|
||||
"result", fakeBodyString2, Node.TEXT_NODE, mockNodeListSingleChild2, null);
|
||||
"result", fakeBodyString2, Node.TEXT_NODE, mockNodeListSingleChild2, null);
|
||||
mockSingleChildResultElement2.setAttribute("name", "success");
|
||||
mockSingleChildResultElement2.setAttribute("type", "dispatcher");
|
||||
Element mockMultipleChildAllowedMethodsElement = new MockElement("result", fakeBodyString,
|
||||
"result", fakeBodyString, Node.TEXT_NODE, mockNodeListMultipleChild, null);
|
||||
"result", fakeBodyString, Node.TEXT_NODE, mockNodeListMultipleChild, null);
|
||||
mockMultipleChildAllowedMethodsElement.setAttribute("name", "input2");
|
||||
mockMultipleChildAllowedMethodsElement.setAttribute("type", "dispatcher");
|
||||
Element mockMultipleChildAllowedMethodsElement2 = new MockElement("result", fakeBodyString,
|
||||
"result", fakeBodyString2, Node.TEXT_NODE, mockNodeListMultipleChild2, null);
|
||||
"result", fakeBodyString2, Node.TEXT_NODE, mockNodeListMultipleChild2, null);
|
||||
mockMultipleChildAllowedMethodsElement2.setAttribute("name", "success2");
|
||||
mockMultipleChildAllowedMethodsElement2.setAttribute("type", "dispatcher");
|
||||
MockNodeList mockGlobalResultsElementChildrenSingle = new MockNodeList();
|
||||
@@ -579,19 +582,19 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
mockGlobalResultsElementChildrenMultiple.addToNodeList(mockMultipleChildAllowedMethodsElement);
|
||||
mockGlobalResultsElementChildrenMultiple.addToNodeList(mockMultipleChildAllowedMethodsElement2);
|
||||
Element mockGlobalResultsElementSingle = new MockElement("global-results", "fakeBody", "global-results", "fakeValue",
|
||||
Node.TEXT_NODE, mockGlobalResultsElementChildrenSingle, null);
|
||||
Node.TEXT_NODE, mockGlobalResultsElementChildrenSingle, null);
|
||||
Element mockGlobalResultsGlobalResultsElementMultiple = new MockElement("global-results", "fakeBody", "global-results", "fakeValue",
|
||||
Node.TEXT_NODE, mockGlobalResultsElementChildrenMultiple, null);
|
||||
Node.TEXT_NODE, mockGlobalResultsElementChildrenMultiple, null);
|
||||
MockNodeList mockPackageElementChildrenSingle = new MockNodeList();
|
||||
mockPackageElementChildrenSingle.addToNodeList(mockGlobalResultsElementSingle);
|
||||
MockNodeList mockPackageElementChildrenMultiple = new MockNodeList();
|
||||
mockPackageElementChildrenMultiple.addToNodeList(mockGlobalResultsGlobalResultsElementMultiple);
|
||||
Element mockPackageElementSingle = new MockElement("package", "fakeBody", "package", "fakeValue",
|
||||
Node.TEXT_NODE, mockPackageElementChildrenSingle, null);
|
||||
Node.TEXT_NODE, mockPackageElementChildrenSingle, null);
|
||||
Element mockPackageElementMultiple = new MockElement("package", "fakeBody", "package", "fakeValue",
|
||||
Node.TEXT_NODE, mockPackageElementChildrenMultiple, null);
|
||||
Node.TEXT_NODE, mockPackageElementChildrenMultiple, null);
|
||||
// Attempt the global laod method using single child Elements first, and confirm the results are as expected.
|
||||
XmlConfigurationProvider prov = new XmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork- test.xml", false);
|
||||
XmlConfigurationProvider prov = new StrutsXmlConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork- test.xml");
|
||||
prov.loadGlobalResults(testPackageConfigBuilder, mockPackageElementSingle);
|
||||
PackageConfig testPackageConfig = testPackageConfigBuilder.build();
|
||||
Map<String, ResultConfig> currentGlobalResults = testPackageConfig.getAllGlobalResults();
|
||||
@@ -606,9 +609,9 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
assertNotNull("inputResultParams (currentGlobalResults - single) is null ?", inputResultParams);
|
||||
assertNotNull("successResultParams (currentGlobalResults - single) is null ?", successResultParams);
|
||||
assertEquals("inputResult (currentGlobalResults - single) resultParam value not equal to fakeBodyString ?",
|
||||
fakeBodyString, inputResultParams.get(resultParam));
|
||||
fakeBodyString, inputResultParams.get(resultParam));
|
||||
assertEquals("successResult (currentGlobalResults - single) resultParam value not equal to fakeBodyString2 ?",
|
||||
fakeBodyString2, successResultParams.get(resultParam));
|
||||
fakeBodyString2, successResultParams.get(resultParam));
|
||||
// Attempt the global laod method using mutliple child Elements next, and confirm the results are as expected.
|
||||
prov.loadGlobalResults(testPackageConfigBuilder, mockPackageElementMultiple);
|
||||
testPackageConfig = testPackageConfigBuilder.build();
|
||||
@@ -624,9 +627,9 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
assertNotNull("inputResultParams2 (currentGlobalResults - multiple) is null ?", inputResultParams2);
|
||||
assertNotNull("successResultParams2 (currentGlobalResults - multiple) is null ?", successResultParams2);
|
||||
assertEquals("inputResult2 (currentGlobalResults - multiple) resultParam value not equal to fakeBodyString ?",
|
||||
fakeBodyString, inputResultParams2.get(resultParam));
|
||||
fakeBodyString, inputResultParams2.get(resultParam));
|
||||
assertEquals("successResult2 (currentGlobalResults - multiple) resultParam value not equal to fakeBodyString2 ?",
|
||||
fakeBodyString2, successResultParams2.get(resultParam));
|
||||
fakeBodyString2, successResultParams2.get(resultParam));
|
||||
// Confirm the previous global results are still present
|
||||
inputResult = currentGlobalResults.get("input");
|
||||
successResult = currentGlobalResults.get("success");
|
||||
@@ -637,9 +640,9 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
assertNotNull("inputResultParams (currentGlobalResults - single) is null ?", inputResultParams);
|
||||
assertNotNull("successResultParams (currentGlobalResults - single) is null ?", successResultParams);
|
||||
assertEquals("inputResult (currentGlobalResults - single) resultParam value not equal to fakeBodyString ?",
|
||||
fakeBodyString, inputResultParams.get(resultParam));
|
||||
fakeBodyString, inputResultParams.get(resultParam));
|
||||
assertEquals("successResult (currentGlobalResults - single) resultParam value not equal to fakeBodyString2 ?",
|
||||
fakeBodyString2, successResultParams.get(resultParam));
|
||||
fakeBodyString2, successResultParams.get(resultParam));
|
||||
inputResult = currentGlobalResults.get("input");
|
||||
successResult = currentGlobalResults.get("success");
|
||||
assertNotNull("inputResult (currentGlobalResults - single) is null ?", inputResult);
|
||||
@@ -649,14 +652,14 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
assertNotNull("inputResultParams (currentGlobalResults - single) is null ?", inputResultParams);
|
||||
assertNotNull("successResultParams (currentGlobalResults - single) is null ?", successResultParams);
|
||||
assertEquals("inputResult (currentGlobalResults - single) resultParam value not equal to fakeBodyString ?",
|
||||
fakeBodyString, inputResultParams.get(resultParam));
|
||||
fakeBodyString, inputResultParams.get(resultParam));
|
||||
assertEquals("successResult (currentGlobalResults - single) resultParam value not equal to fakeBodyString2 ?",
|
||||
fakeBodyString2, successResultParams.get(resultParam));
|
||||
fakeBodyString2, successResultParams.get(resultParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* Mock NodeList.
|
||||
*
|
||||
* <p>
|
||||
* Provides minimal functionality to permit limited mock DOM testing.
|
||||
*/
|
||||
protected class MockNodeList implements org.w3c.dom.NodeList {
|
||||
@@ -669,8 +672,8 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
/**
|
||||
* Produces TEXT_NODE Nodes based on the input List of Strings. Node names
|
||||
* follow a simple pattern "nodeX" where X is the index.
|
||||
*
|
||||
* @param stringList
|
||||
*
|
||||
* @param stringList
|
||||
*/
|
||||
public MockNodeList(List<String> stringList) {
|
||||
if (stringList != null) {
|
||||
@@ -737,7 +740,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
|
||||
/**
|
||||
* MockNode
|
||||
*
|
||||
* <p>
|
||||
* Provides minimal functionality to permit limited mock DOM testing.
|
||||
*/
|
||||
protected class MockNode implements org.w3c.dom.Node {
|
||||
@@ -854,7 +857,7 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
|
||||
@Override
|
||||
public boolean hasChildNodes() {
|
||||
return (childNodes != null ? childNodes.getLength() > 0 : false);
|
||||
return (childNodes != null && childNodes.getLength() > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -960,16 +963,16 @@ public class XmlConfigurationProviderTest extends ConfigurationTestBase {
|
||||
|
||||
/**
|
||||
* Mock Element.
|
||||
*
|
||||
* <p>
|
||||
* Provides minimal functionality to permit limited mock DOM testing.
|
||||
*/
|
||||
protected class MockElement extends MockNode implements org.w3c.dom.Element {
|
||||
final private String tagName;
|
||||
final private String tagBody;
|
||||
final private Map<String, String> attributes;
|
||||
final private Map<String, String> attributes;
|
||||
|
||||
public MockElement(String tagName, String tagBody,
|
||||
String nodeName, String nodeValue, short nodeType, NodeList childNodes, Node parentNode) {
|
||||
String nodeName, String nodeValue, short nodeType, NodeList childNodes, Node parentNode) {
|
||||
super(nodeName, nodeValue, nodeType, childNodes, parentNode);
|
||||
this.tagName = nodeName;
|
||||
this.tagBody = nodeValue;
|
||||
|
||||
@@ -18,11 +18,17 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2.interceptor;
|
||||
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.SimpleAction;
|
||||
import com.opensymphony.xwork2.SimpleFooAction;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.mock.MockActionInvocation;
|
||||
import com.opensymphony.xwork2.mock.MockActionProxy;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -44,6 +50,7 @@ import java.util.Map;
|
||||
* <interceptor-ref name="alias"/>
|
||||
* </action>
|
||||
* </pre>
|
||||
*
|
||||
* @author Matthew Payne
|
||||
*/
|
||||
public class AliasInterceptorTest extends XWorkTestCase {
|
||||
@@ -52,7 +59,7 @@ public class AliasInterceptorTest extends XWorkTestCase {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("aliasSource", "source here");
|
||||
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider);
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy("", "aliasTest", null, params);
|
||||
@@ -72,7 +79,7 @@ public class AliasInterceptorTest extends XWorkTestCase {
|
||||
httpParams.put("notExisting", "from http parameter");
|
||||
params.put(ActionContext.PARAMETERS, HttpParameters.create(httpParams).build());
|
||||
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider);
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy("", "aliasTest", null, params);
|
||||
@@ -94,8 +101,8 @@ public class AliasInterceptorTest extends XWorkTestCase {
|
||||
MockActionProxy map = new MockActionProxy();
|
||||
|
||||
ActionConfig cfg = new ActionConfig.Builder("", "", "")
|
||||
.addParam("aliases", "invalid alias expression")
|
||||
.build();
|
||||
.addParam("aliases", "invalid alias expression")
|
||||
.build();
|
||||
map.setConfig(cfg);
|
||||
|
||||
mai.setProxy(map);
|
||||
@@ -117,8 +124,8 @@ public class AliasInterceptorTest extends XWorkTestCase {
|
||||
MockActionProxy map = new MockActionProxy();
|
||||
|
||||
ActionConfig cfg = new ActionConfig.Builder("", "", "")
|
||||
.addParam("hello", "invalid alias expression")
|
||||
.build();
|
||||
.addParam("hello", "invalid alias expression")
|
||||
.build();
|
||||
map.setConfig(cfg);
|
||||
|
||||
mai.setProxy(map);
|
||||
@@ -141,8 +148,8 @@ public class AliasInterceptorTest extends XWorkTestCase {
|
||||
MockActionProxy map = new MockActionProxy();
|
||||
|
||||
ActionConfig cfg = new ActionConfig.Builder("", "", "")
|
||||
.addParam("hello", "invalid alias expression")
|
||||
.build();
|
||||
.addParam("hello", "invalid alias expression")
|
||||
.build();
|
||||
map.setConfig(cfg);
|
||||
|
||||
mai.setProxy(map);
|
||||
|
||||
+26
-18
@@ -18,7 +18,14 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2.interceptor;
|
||||
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionChainResult;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.ActionProxyFactory;
|
||||
import com.opensymphony.xwork2.DefaultActionProxyFactory;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.SimpleAction;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.config.ConfigurationProvider;
|
||||
@@ -30,15 +37,15 @@ import com.opensymphony.xwork2.config.entities.ResultConfig;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.inject.ContainerBuilder;
|
||||
import com.opensymphony.xwork2.util.location.LocatableProperties;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.struts2.TestResult;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
/**
|
||||
* Unit test for {@link ChainingInterceptor} with a configuration provider.
|
||||
*
|
||||
*/
|
||||
public class ChainingInterceptorWithConfigTest extends XWorkTestCase {
|
||||
|
||||
@@ -59,13 +66,13 @@ public class ChainingInterceptorWithConfigTest extends XWorkTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-default.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-default.xml");
|
||||
container.inject(provider);
|
||||
this.objectFactory = container.getInstance(ObjectFactory.class);
|
||||
loadConfigurationProviders(provider, new MockConfigurationProvider());
|
||||
}
|
||||
|
||||
|
||||
|
||||
private class MockConfigurationProvider implements ConfigurationProvider {
|
||||
private Configuration config;
|
||||
|
||||
@@ -77,7 +84,8 @@ public class ChainingInterceptorWithConfigTest extends XWorkTestCase {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void destroy() { }
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
|
||||
public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {
|
||||
@@ -101,17 +109,17 @@ public class ChainingInterceptorWithConfigTest extends XWorkTestCase {
|
||||
successParams2.put("propertyName", "blah");
|
||||
successParams2.put("expectedValue", null);
|
||||
|
||||
InterceptorConfig chainingInterceptorConfig = new InterceptorConfig.Builder("chainStack", ChainingInterceptor.class.getName()).build();
|
||||
InterceptorConfig chainingInterceptorConfig = new InterceptorConfig.Builder("chainStack", ChainingInterceptor.class.getName()).build();
|
||||
PackageConfig packageConfig = new PackageConfig.Builder("default")
|
||||
.addActionConfig(CHAINED_ACTION, new ActionConfig.Builder("defaultPackage", CHAINED_ACTION, SimpleAction.class.getName())
|
||||
.addResultConfig(new ResultConfig.Builder(Action.ERROR, ActionChainResult.class.getName()).addParam("actionName", CHAINTO_ACTION).build())
|
||||
.build())
|
||||
.addActionConfig(CHAINTO_ACTION, new ActionConfig.Builder("defaultPackage", CHAINTO_ACTION, SimpleAction.class.getName())
|
||||
.addInterceptors(Collections.singletonList(new InterceptorMapping("chainStack", objectFactory.buildInterceptor(chainingInterceptorConfig, interceptorParams))))
|
||||
.addResultConfig(new ResultConfig.Builder(Action.SUCCESS, TestResult.class.getName()).addParams(successParams1).build())
|
||||
.addResultConfig(new ResultConfig.Builder(Action.ERROR, TestResult.class.getName()).addParams(successParams2).build())
|
||||
.build())
|
||||
.build();
|
||||
.addActionConfig(CHAINED_ACTION, new ActionConfig.Builder("defaultPackage", CHAINED_ACTION, SimpleAction.class.getName())
|
||||
.addResultConfig(new ResultConfig.Builder(Action.ERROR, ActionChainResult.class.getName()).addParam("actionName", CHAINTO_ACTION).build())
|
||||
.build())
|
||||
.addActionConfig(CHAINTO_ACTION, new ActionConfig.Builder("defaultPackage", CHAINTO_ACTION, SimpleAction.class.getName())
|
||||
.addInterceptors(Collections.singletonList(new InterceptorMapping("chainStack", objectFactory.buildInterceptor(chainingInterceptorConfig, interceptorParams))))
|
||||
.addResultConfig(new ResultConfig.Builder(Action.SUCCESS, TestResult.class.getName()).addParams(successParams1).build())
|
||||
.addResultConfig(new ResultConfig.Builder(Action.ERROR, TestResult.class.getName()).addParams(successParams2).build())
|
||||
.build())
|
||||
.build();
|
||||
config.addPackageConfig("defaultPackage", packageConfig);
|
||||
config.addPackageConfig("default", new PackageConfig.Builder(packageConfig).name("default").build());
|
||||
}
|
||||
|
||||
+43
-28
@@ -18,10 +18,17 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2.interceptor;
|
||||
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.ModelDrivenAction;
|
||||
import com.opensymphony.xwork2.SimpleAction;
|
||||
import com.opensymphony.xwork2.TestBean;
|
||||
import com.opensymphony.xwork2.TextProvider;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.config.providers.MockConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
|
||||
import com.opensymphony.xwork2.mock.MockActionInvocation;
|
||||
@@ -32,13 +39,21 @@ import com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor;
|
||||
import com.opensymphony.xwork2.util.CompoundRoot;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.ValueStackFactory;
|
||||
import org.junit.Assert;
|
||||
import ognl.OgnlContext;
|
||||
import ognl.PropertyAccessor;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -80,12 +95,12 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
|
||||
public void testInsecureParameters() throws Exception {
|
||||
// given
|
||||
loadConfigurationProviders(new XWorkConfigurationProvider(), new XmlConfigurationProvider("xwork-param-test.xml"));
|
||||
loadConfigurationProviders(new StrutsDefaultConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-param-test.xml"));
|
||||
final Map<String, Object> params = new HashMap<String, Object>() {
|
||||
{
|
||||
put("name", "(#context[\"xwork.MethodAccessor.denyMethodExecution\"]= new " +
|
||||
"java.lang.Boolean(false), #_memberAccess[\"allowStaticMethodAccess\"]= new java.lang.Boolean(true), " +
|
||||
"@java.lang.Runtime@getRuntime().exec('mkdir /tmp/PWNAGE'))(meh)");
|
||||
"java.lang.Boolean(false), #_memberAccess[\"allowStaticMethodAccess\"]= new java.lang.Boolean(true), " +
|
||||
"@java.lang.Runtime@getRuntime().exec('mkdir /tmp/PWNAGE'))(meh)");
|
||||
put("top['name'](0)", "true");
|
||||
put("expression", "#f=#_memberAccess.getClass().getDeclaredField('allowStaticMethodAccess'),#f.setAccessible(true),#f.set(#_memberAccess,true),#req=@org.apache.struts2.ServletActionContext@getRequest(),#resp=@org.apache.struts2.ServletActionContext@getResponse().getWriter(),#resp.println(#req.getRealPath('/')),#resp.close()");
|
||||
}
|
||||
@@ -117,7 +132,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
final String pollution1 = "class.classLoader.jarPath";
|
||||
final String pollution2 = "model.class.classLoader.jarPath";
|
||||
|
||||
loadConfigurationProviders(new XWorkConfigurationProvider(), new XmlConfigurationProvider("xwork-param-test.xml"));
|
||||
loadConfigurationProviders(new StrutsDefaultConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-param-test.xml"));
|
||||
final Map<String, Object> params = new HashMap<String, Object>() {
|
||||
{
|
||||
put(pollution1, "bad");
|
||||
@@ -156,7 +171,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
final String pollution2 = "model.class.classLoader.jarPath";
|
||||
final String pollution3 = "class.classLoader.defaultAssertionStatus";
|
||||
|
||||
loadConfigurationProviders(new XWorkConfigurationProvider(), new XmlConfigurationProvider("xwork-class-param-test.xml"));
|
||||
loadConfigurationProviders(new StrutsDefaultConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-class-param-test.xml"));
|
||||
final Map<String, Object> params = new HashMap<String, Object>() {
|
||||
{
|
||||
put(pollution1, "bad");
|
||||
@@ -240,14 +255,14 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("blah", "This is blah");
|
||||
params.put("#session.foo", "Foo");
|
||||
params.put("\u0023session[\'user\']", "0wn3d");
|
||||
params.put("\\u0023session[\'user\']", "0wn3d");
|
||||
params.put("\u0023session['user']", "0wn3d");
|
||||
params.put("\\u0023session['user']", "0wn3d");
|
||||
params.put("\u0023session.user2", "0wn3d");
|
||||
params.put("\\u0023session.user2", "0wn3d");
|
||||
params.put("('\u0023'%20%2b%20'session[\'user3\']')(unused)", "0wn3d");
|
||||
params.put("('\u0023'%20%2b%20'session['user3']')(unused)", "0wn3d");
|
||||
params.put("('\\u0023' + 'session[\\'user4\\']')(unused)", "0wn3d");
|
||||
params.put("('\u0023'%2b'session[\'user5\']')(unused)", "0wn3d");
|
||||
params.put("('\\u0023'%2b'session[\'user5\']')(unused)", "0wn3d");
|
||||
params.put("('\u0023'%2b'session['user5']')(unused)", "0wn3d");
|
||||
params.put("('\\u0023'%2b'session['user5']')(unused)", "0wn3d");
|
||||
|
||||
HashMap<String, Object> extraContext = new HashMap<>();
|
||||
extraContext.put(ActionContext.PARAMETERS, HttpParameters.create(params).build());
|
||||
@@ -275,7 +290,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
final String pollution5 = "class['classLoader']['jarPath']";
|
||||
final String pollution6 = "class[\"classLoader\"]['jarPath']";
|
||||
|
||||
loadConfigurationProviders(new XWorkConfigurationProvider(), new XmlConfigurationProvider("xwork-param-test.xml"));
|
||||
loadConfigurationProviders(new StrutsDefaultConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-param-test.xml"));
|
||||
final Map<String, Object> params = new HashMap<String, Object>() {
|
||||
{
|
||||
put(pollution1, "bad");
|
||||
@@ -518,8 +533,8 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
public void testEvalExpressionAsParameterName() throws Exception {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("blah", "(#context[\"xwork.MethodAccessor.denyMethodExecution\"]= new " +
|
||||
"java.lang.Boolean(false), #_memberAccess[\"allowStaticMethodAccess\"]= new java.lang.Boolean(true), " +
|
||||
"@java.lang.Runtime@getRuntime().exec('mkdir /tmp/PWNAGE'))(meh)");
|
||||
"java.lang.Boolean(false), #_memberAccess[\"allowStaticMethodAccess\"]= new java.lang.Boolean(true), " +
|
||||
"@java.lang.Runtime@getRuntime().exec('mkdir /tmp/PWNAGE'))(meh)");
|
||||
params.put("top['blah'](0)", "true");
|
||||
|
||||
HashMap<String, Object> extraContext = new HashMap<>();
|
||||
@@ -552,10 +567,10 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
}
|
||||
|
||||
public void testNonexistentParametersGetLoggedInDevMode() throws Exception {
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-test-beans.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-test-beans.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider,
|
||||
new MockConfigurationProvider(Collections.singletonMap("struts.devMode", "true")));
|
||||
new MockConfigurationProvider(Collections.singletonMap("struts.devMode", "true")));
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("not_a_property", "There is no action property named like this");
|
||||
|
||||
@@ -571,10 +586,10 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
}
|
||||
|
||||
public void testNonexistentParametersAreIgnoredInProductionMode() throws Exception {
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-test-beans.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-test-beans.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider,
|
||||
new MockConfigurationProvider(Collections.singletonMap("struts.devMode", "false")));
|
||||
new MockConfigurationProvider(Collections.singletonMap("struts.devMode", "false")));
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("not_a_property", "There is no action property named like this");
|
||||
|
||||
@@ -717,13 +732,13 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
|
||||
public void testBeanListSingleValue() throws Exception {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("beanList.name", new String[] { "Superman" });
|
||||
params.put("beanList.name", new String[]{"Superman"});
|
||||
|
||||
HashMap<String, Object> extraContext = new HashMap<>();
|
||||
extraContext.put(ActionContext.PARAMETERS, HttpParameters.create(params).build());
|
||||
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy("",
|
||||
MockConfigurationProvider.PARAM_INTERCEPTOR_ACTION_NAME, null, extraContext);
|
||||
MockConfigurationProvider.PARAM_INTERCEPTOR_ACTION_NAME, null, extraContext);
|
||||
proxy.execute();
|
||||
SimpleAction action = (SimpleAction) proxy.getAction();
|
||||
assertNotNull(action);
|
||||
@@ -762,9 +777,9 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
|
||||
private ValueStack createStubValueStack(final Map<String, Object> actual) {
|
||||
ValueStack stack = new OgnlValueStack(
|
||||
container.getInstance(XWorkConverter.class),
|
||||
(CompoundRootAccessor) container.getInstance(PropertyAccessor.class, CompoundRoot.class.getName()),
|
||||
container.getInstance(TextProvider.class, "system"), true, true) {
|
||||
container.getInstance(XWorkConverter.class),
|
||||
(CompoundRootAccessor) container.getInstance(PropertyAccessor.class, CompoundRoot.class.getName()),
|
||||
container.getInstance(TextProvider.class, "system"), true, true) {
|
||||
@Override
|
||||
public void setValue(String expr, Object value) {
|
||||
actual.put(expr, value);
|
||||
@@ -804,7 +819,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-test-beans.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-test-beans.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider, new MockConfigurationProvider());
|
||||
|
||||
@@ -816,7 +831,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
|
||||
|
||||
class ValidateAction implements ValidationAware {
|
||||
|
||||
private List<String> messages = new LinkedList<>();
|
||||
private final List<String> messages = new LinkedList<>();
|
||||
private String name;
|
||||
|
||||
public void setActionErrors(Collection<String> errorMessages) {
|
||||
|
||||
+22
-15
@@ -18,7 +18,12 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2.interceptor.annotations;
|
||||
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.ActionProxyFactory;
|
||||
import com.opensymphony.xwork2.DefaultActionProxyFactory;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.config.ConfigurationProvider;
|
||||
@@ -30,6 +35,7 @@ import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.inject.ContainerBuilder;
|
||||
import com.opensymphony.xwork2.mock.MockResult;
|
||||
import com.opensymphony.xwork2.util.location.LocatableProperties;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -43,9 +49,9 @@ public class AnnotationWorkflowInterceptorTest extends XWorkTestCase {
|
||||
private final AnnotationWorkflowInterceptor annotationWorkflow = new AnnotationWorkflowInterceptor();
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception{
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-default.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-default.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider, new MockConfigurationProvider());
|
||||
}
|
||||
@@ -53,14 +59,14 @@ public class AnnotationWorkflowInterceptorTest extends XWorkTestCase {
|
||||
public void testInterceptsBeforeAndAfter() throws Exception {
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy("", ANNOTATED_ACTION, null, null);
|
||||
assertEquals(Action.SUCCESS, proxy.execute());
|
||||
AnnotatedAction action = (AnnotatedAction)proxy.getInvocation().getAction();
|
||||
AnnotatedAction action = (AnnotatedAction) proxy.getInvocation().getAction();
|
||||
assertEquals("interfaceBefore-baseBefore-basePrivateBefore-before-execute-beforeResult-basePrivateBeforeResult-interfaceBeforeResult-after-basePrivateAfter-interfaceAfter", action.log);
|
||||
}
|
||||
|
||||
public void testInterceptsShortcircuitedAction() throws Exception {
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy("", SHORTCIRCUITED_ACTION, null, null);
|
||||
assertEquals("shortcircuit", proxy.execute());
|
||||
ShortcircuitedAction action = (ShortcircuitedAction)proxy.getInvocation().getAction();
|
||||
ShortcircuitedAction action = (ShortcircuitedAction) proxy.getInvocation().getAction();
|
||||
assertEquals("interfaceBefore-baseBefore-basePrivateBefore-before-basePrivateBeforeResult-interfaceBeforeResult", action.log);
|
||||
}
|
||||
|
||||
@@ -75,7 +81,8 @@ public class AnnotationWorkflowInterceptorTest extends XWorkTestCase {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void destroy() { }
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
|
||||
public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {
|
||||
@@ -89,15 +96,15 @@ public class AnnotationWorkflowInterceptorTest extends XWorkTestCase {
|
||||
|
||||
public void loadPackages() throws ConfigurationException {
|
||||
PackageConfig packageConfig = new PackageConfig.Builder("default")
|
||||
.addActionConfig(ANNOTATED_ACTION, new ActionConfig.Builder("defaultPackage", ANNOTATED_ACTION, AnnotatedAction.class.getName())
|
||||
.addInterceptors(Collections.singletonList(new InterceptorMapping("annotationWorkflow", annotationWorkflow)))
|
||||
.addResultConfig(new ResultConfig.Builder("success", MockResult.class.getName()).build())
|
||||
.build())
|
||||
.addActionConfig(SHORTCIRCUITED_ACTION, new ActionConfig.Builder("defaultPackage", SHORTCIRCUITED_ACTION, ShortcircuitedAction.class.getName())
|
||||
.addInterceptors(Collections.singletonList(new InterceptorMapping("annotationWorkflow", annotationWorkflow)))
|
||||
.addResultConfig(new ResultConfig.Builder("shortcircuit", MockResult.class.getName()).build())
|
||||
.build())
|
||||
.build();
|
||||
.addActionConfig(ANNOTATED_ACTION, new ActionConfig.Builder("defaultPackage", ANNOTATED_ACTION, AnnotatedAction.class.getName())
|
||||
.addInterceptors(Collections.singletonList(new InterceptorMapping("annotationWorkflow", annotationWorkflow)))
|
||||
.addResultConfig(new ResultConfig.Builder("success", MockResult.class.getName()).build())
|
||||
.build())
|
||||
.addActionConfig(SHORTCIRCUITED_ACTION, new ActionConfig.Builder("defaultPackage", SHORTCIRCUITED_ACTION, ShortcircuitedAction.class.getName())
|
||||
.addInterceptors(Collections.singletonList(new InterceptorMapping("annotationWorkflow", annotationWorkflow)))
|
||||
.addResultConfig(new ResultConfig.Builder("shortcircuit", MockResult.class.getName()).build())
|
||||
.build())
|
||||
.build();
|
||||
config.addPackageConfig("defaultPackage", packageConfig);
|
||||
config.addPackageConfig("default", new PackageConfig.Builder(packageConfig).name("default").build());
|
||||
}
|
||||
|
||||
@@ -18,13 +18,14 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2.ognl;
|
||||
|
||||
import java.lang.reflect.Member;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
import java.lang.reflect.Member;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class SecurityMemberAccessProxyTest extends XWorkTestCase {
|
||||
private Map<String, Object> context;
|
||||
@@ -35,14 +36,14 @@ public class SecurityMemberAccessProxyTest extends XWorkTestCase {
|
||||
|
||||
context = new HashMap<>();
|
||||
// Set up XWork
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("com/opensymphony/xwork2/spring/actionContext-xwork.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("com/opensymphony/xwork2/spring/actionContext-xwork.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider);
|
||||
}
|
||||
|
||||
public void testProxyAccessIsBlocked() throws Exception {
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy(null,
|
||||
"chaintoAOPedTestSubBeanAction", null, context);
|
||||
"chaintoAOPedTestSubBeanAction", null, context);
|
||||
|
||||
SecurityMemberAccess sma = new SecurityMemberAccess(false, true);
|
||||
sma.setDisallowProxyMemberAccess(true);
|
||||
@@ -55,7 +56,7 @@ public class SecurityMemberAccessProxyTest extends XWorkTestCase {
|
||||
|
||||
public void testProxyAccessIsAccessible() throws Exception {
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy(null,
|
||||
"chaintoAOPedTestSubBeanAction", null, context);
|
||||
"chaintoAOPedTestSubBeanAction", null, context);
|
||||
|
||||
SecurityMemberAccess sma = new SecurityMemberAccess(false, true);
|
||||
|
||||
|
||||
@@ -18,9 +18,16 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2.spring;
|
||||
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.SimpleAction;
|
||||
import com.opensymphony.xwork2.TestSubBean;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import org.apache.commons.lang3.reflect.MethodUtils;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
@@ -35,14 +42,15 @@ import java.util.Map;
|
||||
public class ActionsFromSpringTest extends XWorkTestCase {
|
||||
private ApplicationContext appContext;
|
||||
|
||||
@Override public void setUp() throws Exception {
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
// Set up XWork
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("com/opensymphony/xwork2/spring/actionContext-xwork.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("com/opensymphony/xwork2/spring/actionContext-xwork.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider);
|
||||
appContext = ((SpringObjectFactory)container.getInstance(ObjectFactory.class)).appContext;
|
||||
appContext = ((SpringObjectFactory) container.getInstance(ObjectFactory.class)).appContext;
|
||||
}
|
||||
|
||||
public void testLoadSimpleAction() throws Exception {
|
||||
@@ -87,20 +95,20 @@ public class ActionsFromSpringTest extends XWorkTestCase {
|
||||
String result = action.execute();
|
||||
assertEquals(Action.INPUT, result);
|
||||
}
|
||||
|
||||
|
||||
public void testActionWithSpringResult() throws Exception {
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy(null, "simpleActionSpringResult", null, null);
|
||||
|
||||
proxy.execute();
|
||||
|
||||
SpringResult springResult = (SpringResult) proxy.getInvocation().getResult();
|
||||
assertTrue(springResult.isInitialize());
|
||||
assertNotNull(springResult.getStringParameter());
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy(null, "simpleActionSpringResult", null, null);
|
||||
|
||||
proxy.execute();
|
||||
|
||||
SpringResult springResult = (SpringResult) proxy.getInvocation().getResult();
|
||||
assertTrue(springResult.isInitialize());
|
||||
assertNotNull(springResult.getStringParameter());
|
||||
}
|
||||
|
||||
public void testChainingProxiedActions() throws Exception {
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy(null, "chainedAOPedTestBeanAction",
|
||||
null, null);
|
||||
null, null);
|
||||
|
||||
proxy.execute();
|
||||
|
||||
@@ -131,7 +139,7 @@ public class ActionsFromSpringTest extends XWorkTestCase {
|
||||
extraContext.put(ActionContext.PARAMETERS, HttpParameters.create(params).build());
|
||||
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy(null,
|
||||
"chaintoAOPedTestSubBeanAction", null, extraContext);
|
||||
"chaintoAOPedTestSubBeanAction", null, extraContext);
|
||||
|
||||
// when
|
||||
proxy.execute();
|
||||
@@ -140,6 +148,6 @@ public class ActionsFromSpringTest extends XWorkTestCase {
|
||||
//then
|
||||
assertEquals("S2-047", ((TestSubBean) action).getIssueId());
|
||||
assertFalse("proxied action is accessible!",
|
||||
(boolean) MethodUtils.invokeMethod(action, "isExposeProxy"));
|
||||
(boolean) MethodUtils.invokeMethod(action, "isExposeProxy"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,26 +18,31 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2.spring;
|
||||
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.SimpleAction;
|
||||
import com.opensymphony.xwork2.TestBean;
|
||||
import com.opensymphony.xwork2.TestSubBean;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.util.ProxyUtil;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
/**
|
||||
* Test various utility methods dealing with spring proxies.
|
||||
*
|
||||
*/
|
||||
public class SpringProxyUtilTest extends XWorkTestCase {
|
||||
private ApplicationContext appContext;
|
||||
|
||||
@Override public void setUp() throws Exception {
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
// Set up XWork
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("com/opensymphony/xwork2/spring/actionContext-xwork.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("com/opensymphony/xwork2/spring/actionContext-xwork.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider);
|
||||
appContext = ((SpringObjectFactory)container.getInstance(ObjectFactory.class)).appContext;
|
||||
appContext = ((SpringObjectFactory) container.getInstance(ObjectFactory.class)).appContext;
|
||||
}
|
||||
|
||||
public void testIsProxy() throws Exception {
|
||||
@@ -91,26 +96,26 @@ public class SpringProxyUtilTest extends XWorkTestCase {
|
||||
|
||||
Object simpleAction = appContext.getBean("simple-action");
|
||||
assertFalse(ProxyUtil.isProxyMember(
|
||||
simpleAction.getClass().getMethod("setName", String.class), simpleAction));
|
||||
simpleAction.getClass().getMethod("setName", String.class), simpleAction));
|
||||
|
||||
Object proxiedAction = appContext.getBean("proxied-action");
|
||||
assertTrue(ProxyUtil.isProxyMember(
|
||||
proxiedAction.getClass().getMethod("setExposeProxy", boolean.class), proxiedAction));
|
||||
proxiedAction.getClass().getMethod("setExposeProxy", boolean.class), proxiedAction));
|
||||
|
||||
Object autoProxiedAction = appContext.getBean("auto-proxied-action");
|
||||
assertTrue(ProxyUtil.isProxyMember(
|
||||
autoProxiedAction.getClass().getMethod("getTargetClass"), autoProxiedAction));
|
||||
autoProxiedAction.getClass().getMethod("getTargetClass"), autoProxiedAction));
|
||||
|
||||
Object pointcuttedTestBean = appContext.getBean("pointcutted-test-bean");
|
||||
assertTrue(ProxyUtil.isProxyMember(
|
||||
pointcuttedTestBean.getClass().getMethod("getTargetSource"), pointcuttedTestBean));
|
||||
pointcuttedTestBean.getClass().getMethod("getTargetSource"), pointcuttedTestBean));
|
||||
|
||||
Object pointcuttedTestSubBean = appContext.getBean("pointcutted-test-sub-bean");
|
||||
assertFalse(ProxyUtil.isProxyMember(
|
||||
pointcuttedTestSubBean.getClass().getConstructor(), pointcuttedTestSubBean));
|
||||
pointcuttedTestSubBean.getClass().getConstructor(), pointcuttedTestSubBean));
|
||||
|
||||
Object testAspect = appContext.getBean("test-aspect");
|
||||
assertFalse(ProxyUtil.isProxyMember(
|
||||
testAspect.getClass().getMethod("setExposeProxy", boolean.class), testAspect));
|
||||
testAspect.getClass().getMethod("setExposeProxy", boolean.class), testAspect));
|
||||
}
|
||||
}
|
||||
|
||||
+8
-3
@@ -18,8 +18,13 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2.spring.interceptor;
|
||||
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.SimpleAction;
|
||||
import com.opensymphony.xwork2.TestBean;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||
@@ -52,10 +57,10 @@ public class ActionAutowiringInterceptorTest extends XWorkTestCase {
|
||||
}
|
||||
|
||||
public void testSetAutowireType() throws Exception {
|
||||
XmlConfigurationProvider prov = new XmlConfigurationProvider("xwork-default.xml");
|
||||
XmlConfigurationProvider prov = new StrutsXmlConfigurationProvider("xwork-default.xml");
|
||||
container.inject(prov);
|
||||
prov.setThrowExceptionOnDuplicateBeans(false);
|
||||
XmlConfigurationProvider c = new XmlConfigurationProvider("com/opensymphony/xwork2/spring/xwork-autowire.xml");
|
||||
XmlConfigurationProvider c = new StrutsXmlConfigurationProvider("com/opensymphony/xwork2/spring/xwork-autowire.xml");
|
||||
container.inject(c);
|
||||
loadConfigurationProviders(c, prov);
|
||||
|
||||
|
||||
@@ -39,26 +39,26 @@ public class ClassLoaderUtilTest extends TestCase {
|
||||
}
|
||||
|
||||
public void testGetResources_Multiple() throws IOException {
|
||||
Iterator<URL> i = ClassLoaderUtil.getResources("xwork-1.0.dtd", ClassLoaderUtilTest.class, false);
|
||||
Iterator<URL> i = ClassLoaderUtil.getResources("struts-2.0.dtd", ClassLoaderUtilTest.class, false);
|
||||
assertNotNull(i);
|
||||
|
||||
assertTrue(i.hasNext());
|
||||
URL url = i.next();
|
||||
assertTrue(url.toString().endsWith("xwork-1.0.dtd"));
|
||||
assertTrue(url.toString().endsWith("struts-2.0.dtd"));
|
||||
url = i.next();
|
||||
assertTrue(url.toString().endsWith("xwork-1.0.dtd"));
|
||||
assertTrue(url.toString().endsWith("struts-2.0.dtd"));
|
||||
assertTrue(!i.hasNext());
|
||||
}
|
||||
|
||||
public void testGetResources_Aggregate() throws IOException {
|
||||
Iterator<URL> i = ClassLoaderUtil.getResources("xwork-1.0.dtd", ClassLoaderUtilTest.class, true);
|
||||
Iterator<URL> i = ClassLoaderUtil.getResources("struts-2.0.dtd", ClassLoaderUtilTest.class, true);
|
||||
assertNotNull(i);
|
||||
|
||||
assertTrue(i.hasNext());
|
||||
URL url = i.next();
|
||||
assertTrue(url.toString().endsWith("xwork-1.0.dtd"));
|
||||
assertTrue(url.toString().endsWith("struts-2.0.dtd"));
|
||||
url = i.next();
|
||||
assertTrue(url.toString().endsWith("xwork-1.0.dtd"));
|
||||
assertTrue(url.toString().endsWith("struts-2.0.dtd"));
|
||||
assertTrue(!i.hasNext());
|
||||
}
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <code>MyBeanActionTest</code>
|
||||
@@ -133,7 +133,7 @@ public class MyBeanActionTest extends XWorkTestCase {
|
||||
super.setUp();
|
||||
|
||||
// ensure we're using the default configuration, not simple config
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider);
|
||||
}
|
||||
|
||||
+67
-58
@@ -19,10 +19,19 @@
|
||||
package com.opensymphony.xwork2.util;
|
||||
|
||||
import com.mockobjects.dynamic.Mock;
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.LocalizedTextProvider;
|
||||
import com.opensymphony.xwork2.ModelDriven;
|
||||
import com.opensymphony.xwork2.SimpleAction;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.test.ModelDrivenAction2;
|
||||
import com.opensymphony.xwork2.test.TestBean2;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
@@ -37,52 +46,52 @@ import java.util.ResourceBundle;
|
||||
*
|
||||
* @author jcarreira
|
||||
* @author tm_jee
|
||||
*
|
||||
* @version $Date$ $Id$
|
||||
*/
|
||||
public class StrutsLocalizedTextProviderTest extends XWorkTestCase {
|
||||
|
||||
private LocalizedTextProvider localizedTextProvider;
|
||||
|
||||
public void testNpeWhenClassIsPrimitive() throws Exception {
|
||||
ValueStack stack = ActionContext.getContext().getValueStack();
|
||||
stack.push(new MyObject());
|
||||
String result = localizedTextProvider.findText(MyObject.class, "someObj.someI18nKey", Locale.ENGLISH, "default message", null, stack);
|
||||
System.out.println(result);
|
||||
}
|
||||
|
||||
public static class MyObject extends ActionSupport {
|
||||
public boolean getSomeObj() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void testActionGetTextWithNullObject() throws Exception {
|
||||
MyAction action = new MyAction();
|
||||
|
||||
public void testNpeWhenClassIsPrimitive() throws Exception {
|
||||
ValueStack stack = ActionContext.getContext().getValueStack();
|
||||
stack.push(new MyObject());
|
||||
String result = localizedTextProvider.findText(MyObject.class, "someObj.someI18nKey", Locale.ENGLISH, "default message", null, stack);
|
||||
System.out.println(result);
|
||||
}
|
||||
|
||||
public static class MyObject extends ActionSupport {
|
||||
public boolean getSomeObj() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void testActionGetTextWithNullObject() throws Exception {
|
||||
MyAction action = new MyAction();
|
||||
container.inject(action);
|
||||
|
||||
Mock mockActionInvocation = new Mock(ActionInvocation.class);
|
||||
|
||||
Mock mockActionInvocation = new Mock(ActionInvocation.class);
|
||||
mockActionInvocation.expectAndReturn("getAction", action);
|
||||
ActionContext.getContext()
|
||||
.withActionInvocation((ActionInvocation) mockActionInvocation.proxy())
|
||||
.getValueStack().push(action);
|
||||
|
||||
String message = action.getText("barObj.title");
|
||||
assertEquals("Title:", message);
|
||||
}
|
||||
|
||||
|
||||
public static class MyAction extends ActionSupport {
|
||||
private Bar testBean2;
|
||||
|
||||
public Bar getBarObj() {
|
||||
return testBean2;
|
||||
}
|
||||
public void setBarObj(Bar testBean2) {
|
||||
this.testBean2 = testBean2;
|
||||
}
|
||||
}
|
||||
|
||||
.getValueStack().push(action);
|
||||
|
||||
String message = action.getText("barObj.title");
|
||||
assertEquals("Title:", message);
|
||||
}
|
||||
|
||||
|
||||
public static class MyAction extends ActionSupport {
|
||||
private Bar testBean2;
|
||||
|
||||
public Bar getBarObj() {
|
||||
return testBean2;
|
||||
}
|
||||
|
||||
public void setBarObj(Bar testBean2) {
|
||||
this.testBean2 = testBean2;
|
||||
}
|
||||
}
|
||||
|
||||
public void testActionGetText() throws Exception {
|
||||
ModelDrivenAction2 action = new ModelDrivenAction2();
|
||||
container.inject(action);
|
||||
@@ -207,7 +216,7 @@ public class StrutsLocalizedTextProviderTest extends XWorkTestCase {
|
||||
public void testLocalizedDateFormatIsUsed() throws ParseException {
|
||||
localizedTextProvider.addDefaultResourceBundle("com/opensymphony/xwork2/util/LocalizedTextUtilTest");
|
||||
Date date = DateFormat.getDateInstance(DateFormat.SHORT, Locale.US).parse("01/01/2015");
|
||||
Object[] params = new Object[]{ date };
|
||||
Object[] params = new Object[]{date};
|
||||
String usDate = localizedTextProvider.findDefaultText("test.format.date", Locale.US, params);
|
||||
String germanDate = localizedTextProvider.findDefaultText("test.format.date", Locale.GERMANY, params);
|
||||
assertEquals(usDate, "1/1/15");
|
||||
@@ -253,26 +262,26 @@ public class StrutsLocalizedTextProviderTest extends XWorkTestCase {
|
||||
|
||||
/**
|
||||
* Unit test to confirm expected behaviour of "clearing methods" provided to
|
||||
* StrutsLocalizedTextProvider (from AbstractLocalizedTextProvider).
|
||||
* StrutsLocalizedTextProvider (from AbstractLocalizedTextProvider).
|
||||
*
|
||||
* @since 2.6
|
||||
*/
|
||||
public void testLocalizedTextProviderClearingMethods() {
|
||||
TestStrutsLocalizedTextProvider testStrutsLocalizedTextProvider = new TestStrutsLocalizedTextProvider();
|
||||
assertTrue("testStrutsLocalizedTextProvider not instance of AbstractLocalizedTextProvider ?",
|
||||
testStrutsLocalizedTextProvider instanceof AbstractLocalizedTextProvider);
|
||||
testStrutsLocalizedTextProvider instanceof AbstractLocalizedTextProvider);
|
||||
assertEquals("testStrutsLocalizedTextProvider starting default bundle map size not 0 before any retrievals ?",
|
||||
0, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
0, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
|
||||
// Access the two default bundles to populate their cache entries and test bundle map size.
|
||||
ResourceBundle tempBundle = testStrutsLocalizedTextProvider.findResourceBundle(
|
||||
TestStrutsLocalizedTextProvider.XWORK_MESSAGES_BUNDLE, Locale.ENGLISH);
|
||||
TestStrutsLocalizedTextProvider.XWORK_MESSAGES_BUNDLE, Locale.ENGLISH);
|
||||
assertNotNull("XWORK_MESSAGES_BUNDLE retrieval null ?", tempBundle);
|
||||
tempBundle = testStrutsLocalizedTextProvider.findResourceBundle(
|
||||
TestStrutsLocalizedTextProvider.STRUTS_MESSAGES_BUNDLE, Locale.ENGLISH);
|
||||
TestStrutsLocalizedTextProvider.STRUTS_MESSAGES_BUNDLE, Locale.ENGLISH);
|
||||
assertNotNull("STRUTS_MESSAGES_BUNDLE retrieval null ?", tempBundle);
|
||||
assertEquals("testStrutsLocalizedTextProvider bundle map size not 2 after retrievals ?",
|
||||
2, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
2, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
|
||||
// Add and then access four test bundles to populate their cache entries and test bundle map size.
|
||||
testStrutsLocalizedTextProvider.addDefaultResourceBundle("com/opensymphony/xwork2/util/LocalizedTextUtilTest");
|
||||
@@ -280,39 +289,39 @@ public class StrutsLocalizedTextProviderTest extends XWorkTestCase {
|
||||
testStrutsLocalizedTextProvider.addDefaultResourceBundle("com/opensymphony/xwork2/SimpleAction");
|
||||
testStrutsLocalizedTextProvider.addDefaultResourceBundle("com/opensymphony/xwork2/test");
|
||||
tempBundle = testStrutsLocalizedTextProvider.findResourceBundle(
|
||||
"com/opensymphony/xwork2/util/LocalizedTextUtilTest", Locale.ENGLISH);
|
||||
"com/opensymphony/xwork2/util/LocalizedTextUtilTest", Locale.ENGLISH);
|
||||
assertNotNull("com/opensymphony/xwork2/util/LocalizedTextUtilTest retrieval null ?", tempBundle);
|
||||
tempBundle = testStrutsLocalizedTextProvider.findResourceBundle(
|
||||
"com/opensymphony/xwork2/util/FindMe", Locale.ENGLISH);
|
||||
"com/opensymphony/xwork2/util/FindMe", Locale.ENGLISH);
|
||||
assertNotNull("com/opensymphony/xwork2/util/FindMe retrieval null ?", tempBundle);
|
||||
tempBundle = testStrutsLocalizedTextProvider.findResourceBundle(
|
||||
"com/opensymphony/xwork2/SimpleAction", Locale.ENGLISH);
|
||||
"com/opensymphony/xwork2/SimpleAction", Locale.ENGLISH);
|
||||
assertNotNull("com/opensymphony/xwork2/SimpleAction retrieval null ?", tempBundle);
|
||||
tempBundle = testStrutsLocalizedTextProvider.findResourceBundle(
|
||||
"com/opensymphony/xwork2/test", Locale.ENGLISH);
|
||||
"com/opensymphony/xwork2/test", Locale.ENGLISH);
|
||||
assertNotNull("com/opensymphony/xwork2/test retrieval null ?", tempBundle);
|
||||
assertEquals("testStrutsLocalizedTextProvider bundle map size not 6 after retrievals ?",
|
||||
6, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
6, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
|
||||
// Expect the call to be ineffective due to deprecation and change to a "no-op" (but shouldn't throw an Exception or cause failure).
|
||||
testStrutsLocalizedTextProvider.callClearBundleNoLocale("com/opensymphony/xwork2/test");
|
||||
assertEquals("testStrutsLocalizedTextProvider bundle map size not 6 after non-locale clear call ?",
|
||||
6, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
6, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
|
||||
// Expect the call to function with bundle name + locale. Remove all four of the non-default
|
||||
// bundles and confirm the bundle map size changes.
|
||||
testStrutsLocalizedTextProvider.callClearBundleWithLocale("com/opensymphony/xwork2/test", Locale.ENGLISH);
|
||||
assertEquals("testStrutsLocalizedTextProvider bundle map size not 5 after locale clear call ?",
|
||||
5, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
5, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
testStrutsLocalizedTextProvider.callClearBundleWithLocale("com/opensymphony/xwork2/SimpleAction", Locale.ENGLISH);
|
||||
assertEquals("testStrutsLocalizedTextProvider bundle map size not 4 after locale clear call ?",
|
||||
4, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
4, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
testStrutsLocalizedTextProvider.callClearBundleWithLocale("com/opensymphony/xwork2/util/FindMe", Locale.ENGLISH);
|
||||
assertEquals("testStrutsLocalizedTextProvider bundle map size not 3 after locale clear call ?",
|
||||
3, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
3, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
testStrutsLocalizedTextProvider.callClearBundleWithLocale("com/opensymphony/xwork2/util/LocalizedTextUtilTest", Locale.ENGLISH);
|
||||
assertEquals("testStrutsLocalizedTextProvider bundle map size not 2 after locale clear call ?",
|
||||
2, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
2, testStrutsLocalizedTextProvider.currentBundlesMapSize());
|
||||
|
||||
// Confirm the missing bundles cache clearing method does not produce any Exceptions or failures.
|
||||
testStrutsLocalizedTextProvider.callClearMissingBundlesCache();
|
||||
@@ -321,12 +330,12 @@ public class StrutsLocalizedTextProviderTest extends XWorkTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider);
|
||||
|
||||
localizedTextProvider = container.getInstance(LocalizedTextProvider.class);
|
||||
|
||||
|
||||
ActionContext.getContext().withLocale(Locale.US);
|
||||
}
|
||||
|
||||
@@ -345,7 +354,7 @@ public class StrutsLocalizedTextProviderTest extends XWorkTestCase {
|
||||
|
||||
public void callClearBundleNoLocale(String bundleName) {
|
||||
super.clearBundle(bundleName);
|
||||
}
|
||||
}
|
||||
|
||||
public void callClearBundleWithLocale(String bundleName, Locale locale) {
|
||||
super.clearBundle(bundleName, locale);
|
||||
|
||||
+2
-2
@@ -29,9 +29,9 @@ import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.interceptor.ValidationAware;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@@ -306,7 +306,7 @@ public class DoubleRangeFieldValidatorTest extends XWorkTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-default.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-default.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider, new MockConfigurationProvider());
|
||||
val = new DoubleRangeFieldValidator();
|
||||
|
||||
@@ -20,10 +20,11 @@ package com.opensymphony.xwork2.validator;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.interceptor.ValidationAware;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.MockConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.interceptor.ValidationAware;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -63,7 +64,7 @@ public class IntRangeValidatorTest extends XWorkTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-test-beans.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-test-beans.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider, new MockConfigurationProvider());
|
||||
}
|
||||
|
||||
@@ -20,10 +20,11 @@ package com.opensymphony.xwork2.validator;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.interceptor.ValidationAware;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.MockConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.interceptor.ValidationAware;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -60,7 +61,7 @@ public class LongRangeValidatorTest extends XWorkTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-test-beans.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-test-beans.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider, new MockConfigurationProvider());
|
||||
}
|
||||
|
||||
@@ -18,8 +18,13 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2.validator;
|
||||
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.ModelDrivenAction;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -31,7 +36,7 @@ import java.util.Map;
|
||||
* ModelDrivenValidationTest
|
||||
*
|
||||
* @author Jason Carreira
|
||||
* Created Oct 1, 2003 10:08:25 AM
|
||||
* Created Oct 1, 2003 10:08:25 AM
|
||||
*/
|
||||
public class ModelDrivenValidationTest extends XWorkTestCase {
|
||||
|
||||
@@ -42,7 +47,7 @@ public class ModelDrivenValidationTest extends XWorkTestCase {
|
||||
Map<String, Object> context = new HashMap<>();
|
||||
context.put(ActionContext.PARAMETERS, HttpParameters.create(params).build());
|
||||
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-sample.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider);
|
||||
ActionProxy proxy = actionProxyFactory.createActionProxy(null, "TestModelDrivenValidation", null, context);
|
||||
|
||||
@@ -20,10 +20,11 @@ package com.opensymphony.xwork2.validator;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.interceptor.ValidationAware;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.MockConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.interceptor.ValidationAware;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -60,7 +61,7 @@ public class ShortRangeValidatorTest extends XWorkTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-test-beans.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-test-beans.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider, new MockConfigurationProvider());
|
||||
}
|
||||
|
||||
+13
-4
@@ -18,15 +18,24 @@
|
||||
*/
|
||||
package com.opensymphony.xwork2.validator;
|
||||
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.SimpleAction;
|
||||
import com.opensymphony.xwork2.TextProviderFactory;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.MockConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.interceptor.ValidationAware;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.validator.validators.ValidatorSupport;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -229,14 +238,14 @@ public class SimpleActionValidationTest extends XWorkTestCase {
|
||||
public void testInitializable() throws Exception {
|
||||
ValidatorFactory validatorFactory = container.getInstance(ValidatorFactory.class);
|
||||
assertEquals("com.opensymphony.xwork2.validator.validators.RequiredFieldValidator",
|
||||
validatorFactory.lookupRegisteredValidatorType("requiredAnother"));
|
||||
validatorFactory.lookupRegisteredValidatorType("requiredAnother"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
XmlConfigurationProvider provider = new XmlConfigurationProvider("xwork-test-beans.xml");
|
||||
XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-test-beans.xml");
|
||||
container.inject(provider);
|
||||
loadConfigurationProviders(provider, new MockConfigurationProvider());
|
||||
}
|
||||
|
||||
@@ -20,9 +20,10 @@ package com.opensymphony.xwork2.validator;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.interceptor.ValidationAware;
|
||||
import com.opensymphony.xwork2.XWorkTestCase;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.interceptor.ValidationAware;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.apache.struts2.dispatcher.HttpParameters;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -127,9 +128,9 @@ public class ValidatorAnnotationTest extends XWorkTestCase {
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
XmlConfigurationProvider provider1 = new XmlConfigurationProvider("xwork-default.xml");
|
||||
XmlConfigurationProvider provider1 = new StrutsXmlConfigurationProvider("xwork-default.xml");
|
||||
container.inject(provider1);
|
||||
XmlConfigurationProvider provider2 = new XmlConfigurationProvider("xwork-test-validation.xml");
|
||||
XmlConfigurationProvider provider2 = new StrutsXmlConfigurationProvider("xwork-test-validation.xml");
|
||||
container.inject(provider2);
|
||||
loadConfigurationProviders(provider1, provider2);
|
||||
}
|
||||
|
||||
+35
-33
@@ -23,7 +23,6 @@ import com.opensymphony.xwork2.ActionProxyFactory;
|
||||
import com.opensymphony.xwork2.DefaultActionProxyFactory;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.config.ConfigurationProvider;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.inject.ContainerBuilder;
|
||||
import com.opensymphony.xwork2.inject.Context;
|
||||
import com.opensymphony.xwork2.inject.Factory;
|
||||
@@ -32,6 +31,7 @@ import com.opensymphony.xwork2.mock.MockActionProxy;
|
||||
import com.opensymphony.xwork2.test.StubConfigurationProvider;
|
||||
import com.opensymphony.xwork2.util.location.LocatableProperties;
|
||||
import org.apache.struts2.StrutsInternalTestCase;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
@@ -43,63 +43,65 @@ public class PrefixBasedActionProxyFactoryTest extends StrutsInternalTestCase {
|
||||
public void testDifferentPrefixes() throws Exception {
|
||||
initFactory("/ns1:prefix1,/ns2:prefix2");
|
||||
|
||||
ActionProxy proxy1 = factory.createActionProxy("/ns1", "", "", Collections.<String, Object>emptyMap(), false, true);
|
||||
ActionProxy proxy1 = factory.createActionProxy("/ns1", "", "", Collections.emptyMap(), false, true);
|
||||
assertTrue(proxy1 instanceof Prefix1ActionProxy);
|
||||
|
||||
ActionProxy proxy2 = factory.createActionProxy("/ns2", "", "", Collections.<String, Object>emptyMap(), false, true);
|
||||
ActionProxy proxy2 = factory.createActionProxy("/ns2", "", "", Collections.emptyMap(), false, true);
|
||||
assertTrue(proxy2 instanceof Prefix2ActionProxy);
|
||||
}
|
||||
|
||||
public void testFallbackToDefault() throws Exception {
|
||||
initFactory("/ns1:prefix1");
|
||||
|
||||
ActionProxy proxy1 = factory.createActionProxy("/ns1", "", "", Collections.<String, Object>emptyMap(), false, true);
|
||||
ActionProxy proxy1 = factory.createActionProxy("/ns1", "", "", Collections.emptyMap(), false, true);
|
||||
assertTrue(proxy1 instanceof Prefix1ActionProxy);
|
||||
|
||||
ActionProxy proxy2 = factory.createActionProxy("", "Foo", "", Collections.<String, Object>emptyMap(), false, true);
|
||||
ActionProxy proxy2 = factory.createActionProxy("", "Foo", "", Collections.emptyMap(), false, true);
|
||||
assertTrue(proxy2 instanceof StrutsActionProxy);
|
||||
}
|
||||
|
||||
public void testEmptyPrefix() throws Exception {
|
||||
initFactory(":prefix1");
|
||||
|
||||
ActionProxy proxy1 = factory.createActionProxy("/ns1", "", "", Collections.<String, Object>emptyMap(), false, true);
|
||||
ActionProxy proxy1 = factory.createActionProxy("/ns1", "", "", Collections.emptyMap(), false, true);
|
||||
assertTrue(proxy1 instanceof Prefix1ActionProxy);
|
||||
|
||||
ActionProxy proxy2 = factory.createActionProxy("/ns2", "", "", Collections.<String, Object>emptyMap(), false, true);
|
||||
ActionProxy proxy2 = factory.createActionProxy("/ns2", "", "", Collections.emptyMap(), false, true);
|
||||
assertTrue(proxy2 instanceof Prefix1ActionProxy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
ConfigurationProvider[] providers = new ConfigurationProvider[]{
|
||||
new XmlConfigurationProvider("xwork-sample.xml"),
|
||||
new StubConfigurationProvider() {
|
||||
@Override
|
||||
public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {
|
||||
builder.factory(ActionProxyFactory.class, "prefix1", new Factory() {
|
||||
public Object create(Context context) throws Exception {
|
||||
return new Prefix1Factory();
|
||||
}
|
||||
public Class type() {
|
||||
return Prefix1Factory.class;
|
||||
}
|
||||
}, Scope.SINGLETON);
|
||||
}
|
||||
},
|
||||
new StubConfigurationProvider() {
|
||||
@Override
|
||||
public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {
|
||||
builder.factory(ActionProxyFactory.class, "prefix2", new Factory() {
|
||||
public Object create(Context context) throws Exception {
|
||||
return new Prefix2Factory();
|
||||
}
|
||||
public Class type() {
|
||||
return Prefix2Factory.class;
|
||||
}
|
||||
}, Scope.SINGLETON);
|
||||
}
|
||||
new StrutsXmlConfigurationProvider("xwork-sample.xml"),
|
||||
new StubConfigurationProvider() {
|
||||
@Override
|
||||
public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {
|
||||
builder.factory(ActionProxyFactory.class, "prefix1", new Factory() {
|
||||
public Object create(Context context) throws Exception {
|
||||
return new Prefix1Factory();
|
||||
}
|
||||
|
||||
public Class type() {
|
||||
return Prefix1Factory.class;
|
||||
}
|
||||
}, Scope.SINGLETON);
|
||||
}
|
||||
},
|
||||
new StubConfigurationProvider() {
|
||||
@Override
|
||||
public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {
|
||||
builder.factory(ActionProxyFactory.class, "prefix2", new Factory() {
|
||||
public Object create(Context context) throws Exception {
|
||||
return new Prefix2Factory();
|
||||
}
|
||||
|
||||
public Class type() {
|
||||
return Prefix2Factory.class;
|
||||
}
|
||||
}, Scope.SINGLETON);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
loadConfigurationProviders(providers);
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
*/
|
||||
package org.apache.struts2.interceptor;
|
||||
|
||||
|
||||
import static org.apache.struts2.interceptor.ResourceIsolationPolicy.DEST_EMBED;
|
||||
import static org.apache.struts2.interceptor.ResourceIsolationPolicy.DEST_OBJECT;
|
||||
import static org.apache.struts2.interceptor.ResourceIsolationPolicy.DEST_SCRIPT;
|
||||
@@ -43,6 +42,7 @@ import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
|
||||
import com.opensymphony.xwork2.mock.MockActionInvocation;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
|
||||
@@ -155,7 +155,7 @@ public class FetchMetadataInterceptorTest extends XWorkTestCase {
|
||||
// Perform a multi-step test to confirm (indirectly) that the method parameter injection of setExemptedPaths() for
|
||||
// the FetchMetadataInterceptor is functioning as expected, when configured appropriately.
|
||||
// Ensure we're using the specific test configuration, not the default simple configuration.
|
||||
XmlConfigurationProvider configurationProvider = new XmlConfigurationProvider("struts-testing.xml");
|
||||
XmlConfigurationProvider configurationProvider = new StrutsXmlConfigurationProvider("struts-testing.xml");
|
||||
container.inject(configurationProvider);
|
||||
loadConfigurationProviders(configurationProvider);
|
||||
|
||||
|
||||
+5
-6
@@ -19,10 +19,9 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.1.3//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.1.3.dtd"
|
||||
>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
|
||||
<xwork order="2">
|
||||
</xwork>
|
||||
<struts order="2">
|
||||
</struts>
|
||||
|
||||
+5
-6
@@ -19,10 +19,9 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.1.3//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.1.3.dtd"
|
||||
>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
|
||||
<xwork order="3">
|
||||
</xwork>
|
||||
<struts order="3">
|
||||
</struts>
|
||||
|
||||
+5
-6
@@ -19,10 +19,9 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.1.3//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.1.3.dtd"
|
||||
>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
|
||||
<xwork order="1">
|
||||
</xwork>
|
||||
<struts order="1">
|
||||
</struts>
|
||||
|
||||
@@ -19,13 +19,11 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml"/>
|
||||
<package name="default">
|
||||
<result-types>
|
||||
<result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult" default="true"/>
|
||||
@@ -55,7 +53,7 @@
|
||||
<param name="bar">23</param>
|
||||
<param name="testXW412">foo.jspa?fooID=${fooID}&something=bar</param>
|
||||
<param name="testXW412Again">
|
||||
something
|
||||
something
|
||||
</param>
|
||||
<param name="testForXW171"></param>
|
||||
</action>
|
||||
@@ -63,19 +61,19 @@
|
||||
<action name="Foo" class="com.opensymphony.xwork2.SimpleAction">
|
||||
<param name="foo">18</param>
|
||||
<param name="bar">24</param>
|
||||
<result name="success" type="mock" />
|
||||
<result name="success" type="mock"/>
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</action>
|
||||
|
||||
<action name="WildCard" class="com.opensymphony.xwork2.SimpleAction">
|
||||
<result name="*" type="mock" />
|
||||
<result name="*" type="mock"/>
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</action>
|
||||
|
||||
<action name="FooBar" class="com.opensymphony.xwork2.SimpleAction">
|
||||
<param name="foo">18</param>
|
||||
<param name="bar">24</param>
|
||||
<result name="success" type="mock" />
|
||||
<result name="success" type="mock"/>
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
<exception-mapping name="runtime" exception="java.lang.RuntimeException" result="exception"/>
|
||||
</action>
|
||||
@@ -99,4 +97,4 @@
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.0.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<package name="namespace5" extends="namespace4" namespace="/namespace5">
|
||||
<action name="action5" class="com.opensymphony.xwork2.SimpleAction">
|
||||
<result name="success" type="chain"/>
|
||||
@@ -32,4 +30,4 @@
|
||||
</action>
|
||||
</package>
|
||||
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.0.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<package name="namespace4" extends="namespace1" namespace="/namespace4">
|
||||
<interceptors>
|
||||
<interceptor name="staticParams" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
|
||||
@@ -38,4 +36,4 @@
|
||||
|
||||
|
||||
<include file="com/opensymphony/xwork2/config/providers/xwork-include-after-package-2.xml" />
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.0.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<package name="namespace2" extends="namespace1" namespace="/namespace2">
|
||||
<action name="action2" class="com.opensymphony.xwork2.SimpleAction">
|
||||
<result name="success" type="chain"/>
|
||||
@@ -32,4 +30,4 @@
|
||||
</action>
|
||||
</package>
|
||||
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.0.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
|
||||
<package name="namespace1" extends="default" namespace="/namespace1">
|
||||
@@ -40,4 +38,4 @@
|
||||
|
||||
<include file="com/opensymphony/xwork2/config/providers/xwork-include-before-package-2.xml" />
|
||||
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.0.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-default.xml" />
|
||||
|
||||
<package name="default">
|
||||
@@ -40,4 +38,4 @@
|
||||
|
||||
|
||||
<include file="com/opensymphony/xwork2/config/providers/xwork-include-after-package.xml" />
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default">
|
||||
|
||||
@@ -41,4 +39,4 @@
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.0.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<package name="default">
|
||||
|
||||
<result-types>
|
||||
@@ -57,4 +55,4 @@
|
||||
<param name="testForXW171"></param>
|
||||
</action>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+10
-12
@@ -19,13 +19,11 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml"/>
|
||||
<package name="default">
|
||||
<result-types>
|
||||
<result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult" default="true"/>
|
||||
@@ -55,7 +53,7 @@
|
||||
<param name="bar">23</param>
|
||||
<param name="testXW412">foo.jspa?fooID=${fooID}&something=bar</param>
|
||||
<param name="testXW412Again">
|
||||
something
|
||||
something
|
||||
</param>
|
||||
<param name="testForXW171"></param>
|
||||
</action>
|
||||
@@ -63,19 +61,19 @@
|
||||
<action name="Foo" class="com.opensymphony.xwork2.SimpleAction">
|
||||
<param name="foo">18</param>
|
||||
<param name="bar">24</param>
|
||||
<result name="success" type="mock" />
|
||||
<result name="success" type="mock"/>
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</action>
|
||||
|
||||
<action name="WildCard" class="com.opensymphony.xwork2.SimpleAction">
|
||||
<result name="*" type="mock" />
|
||||
<result name="*" type="mock"/>
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</action>
|
||||
|
||||
<action name="FooBar" class="com.opensymphony.xwork2.SimpleAction">
|
||||
<param name="foo">18</param>
|
||||
<param name="bar">24</param>
|
||||
<result name="success" type="mock" />
|
||||
<result name="success" type="mock"/>
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
<exception-mapping name="runtime" exception="java.lang.RuntimeException" result="exception"/>
|
||||
</action>
|
||||
@@ -99,4 +97,4 @@
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.5//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.5.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<package name="default" strict-method-invocation="false">
|
||||
<global-allowed-methods>input,cancel</global-allowed-methods>
|
||||
<action name="Default">
|
||||
@@ -68,4 +66,4 @@
|
||||
<allowed-methods>foo,bar</allowed-methods>
|
||||
</action>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default" />
|
||||
|
||||
@@ -35,4 +33,4 @@
|
||||
<package name="anotherCircularPackage" extends="anotherCircularPackage2"/>
|
||||
|
||||
<package name="anotherCircularPackage2" extends="anotherCircularPackage"/>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+9
-11
@@ -19,16 +19,14 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml"/>
|
||||
<package name="default"/>
|
||||
|
||||
<xwork>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default" />
|
||||
<package name="namespacepkg" namespace="/namespace/set"/>
|
||||
|
||||
<package name="namespacepkg" namespace="/namespace/set" />
|
||||
|
||||
<package name="abstractpkg" abstract="true" />
|
||||
</xwork>
|
||||
<package name="abstractpkg" abstract="true"/>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default" />
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+6
-8
@@ -19,14 +19,12 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.0.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<package name="hasDefaultClassRef">
|
||||
<default-class-ref class="com.opensymphony.xwork2.ActionSupport" />
|
||||
<default-class-ref class="com.opensymphony.xwork2.ActionSupport"/>
|
||||
</package>
|
||||
<package name="noDefaultClassRef"/>
|
||||
</xwork>
|
||||
</struts>
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.5//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.5.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
|
||||
<constant name="foo" value="bar"/>
|
||||
|
||||
@@ -43,4 +41,4 @@
|
||||
|
||||
<constant name="struts.devMode" value="${env.STRUTS_DEV_MODE:false}"/>
|
||||
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default">
|
||||
<result-types>
|
||||
@@ -51,4 +49,4 @@
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+42
-44
@@ -19,50 +19,48 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="parent" namespace="/base">
|
||||
<result-types>
|
||||
<result-type name="mockResult" class="com.opensymphony.xwork2.mock.MockResult" />
|
||||
</result-types>
|
||||
<global-results>
|
||||
<result name="mockResult1" type="mockResult">
|
||||
<param name="identity">p1</param>
|
||||
</result>
|
||||
<result name="mockResult2" type="mockResult">
|
||||
<param name="identity">p2</param>
|
||||
</result>
|
||||
</global-results>
|
||||
<action name="parentAction" />
|
||||
</package>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml"/>
|
||||
<package name="parent" namespace="/base">
|
||||
<result-types>
|
||||
<result-type name="mockResult" class="com.opensymphony.xwork2.mock.MockResult"/>
|
||||
</result-types>
|
||||
<global-results>
|
||||
<result name="mockResult1" type="mockResult">
|
||||
<param name="identity">p1</param>
|
||||
</result>
|
||||
<result name="mockResult2" type="mockResult">
|
||||
<param name="identity">p2</param>
|
||||
</result>
|
||||
</global-results>
|
||||
<action name="parentAction"/>
|
||||
</package>
|
||||
|
||||
|
||||
<package name="another" namespace="/base">
|
||||
<result-types>
|
||||
<result-type name="anotherMockResult" class="com.opensymphony.xwork2.mock.MockResult" />
|
||||
</result-types>
|
||||
<global-results>
|
||||
<result name="mockResult1" type="anotherMockResult">
|
||||
<param name="identity">a1</param>
|
||||
</result>
|
||||
<result name="mockResult2" type="anotherMockResult">
|
||||
<param name="identity">a2</param>
|
||||
</result>
|
||||
</global-results>
|
||||
<action name="anotherAction" />
|
||||
</package>
|
||||
<package name="another" namespace="/base">
|
||||
<result-types>
|
||||
<result-type name="anotherMockResult" class="com.opensymphony.xwork2.mock.MockResult"/>
|
||||
</result-types>
|
||||
<global-results>
|
||||
<result name="mockResult1" type="anotherMockResult">
|
||||
<param name="identity">a1</param>
|
||||
</result>
|
||||
<result name="mockResult2" type="anotherMockResult">
|
||||
<param name="identity">a2</param>
|
||||
</result>
|
||||
</global-results>
|
||||
<action name="anotherAction"/>
|
||||
</package>
|
||||
|
||||
<package name="child" extends="parent" namespace="/base">
|
||||
<global-results>
|
||||
<result name="mockResult1" type="mockResult">
|
||||
<param name="identity">c1</param>
|
||||
</result>
|
||||
</global-results>
|
||||
<action name="childAction" />
|
||||
</package>
|
||||
</xwork>
|
||||
<package name="child" extends="parent" namespace="/base">
|
||||
<global-results>
|
||||
<result name="mockResult1" type="mockResult">
|
||||
<param name="identity">c1</param>
|
||||
</result>
|
||||
</global-results>
|
||||
<action name="childAction"/>
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,11 +19,9 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="com/opensymphony/xwork2/config/providers/xwork-include-*.xml"/>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<!-- this package has a default interceptor ref - so actions with no refs should have the default ref -->
|
||||
<package name="default">
|
||||
<interceptors>
|
||||
@@ -48,4 +46,4 @@
|
||||
<interceptor-ref name="logging"/>
|
||||
</action>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+6
-8
@@ -19,13 +19,11 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml"/>
|
||||
<package name="default">
|
||||
<interceptors>
|
||||
<interceptor name="noop" class="org.apache.struts2.interceptor.NoOpInterceptor"/>
|
||||
@@ -52,4 +50,4 @@
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-6
@@ -19,11 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd">
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="packageOne">
|
||||
<result-types>
|
||||
@@ -60,5 +59,5 @@
|
||||
<result name="success" type="mock">test2</result>
|
||||
</action>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default">
|
||||
<interceptors>
|
||||
@@ -55,4 +53,4 @@
|
||||
</action>
|
||||
</package>
|
||||
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+45
-43
@@ -19,53 +19,55 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.0//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.0.dtd">
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<package name="packageOne">
|
||||
<result-types>
|
||||
<result-type name="mock" class="com.opensymphony.xwork2.mock.MockResult"/>
|
||||
</result-types>
|
||||
|
||||
<xwork>
|
||||
<package name="packageOne">
|
||||
<result-types>
|
||||
<result-type name="mock" class="com.opensymphony.xwork2.mock.MockResult" />
|
||||
</result-types>
|
||||
<interceptors>
|
||||
<interceptor name="interceptorOne"
|
||||
class="com.opensymphony.xwork2.config.providers.InterceptorForTestPurpose"/>
|
||||
<interceptor name="interceptorTwo"
|
||||
class="com.opensymphony.xwork2.config.providers.InterceptorForTestPurpose"/>
|
||||
<interceptor name="interceptorThree"
|
||||
class="com.opensymphony.xwork2.config.providers.InterceptorForTestPurpose"/>
|
||||
|
||||
<interceptors>
|
||||
<interceptor name="interceptorOne" class="com.opensymphony.xwork2.config.providers.InterceptorForTestPurpose" />
|
||||
<interceptor name="interceptorTwo" class="com.opensymphony.xwork2.config.providers.InterceptorForTestPurpose" />
|
||||
<interceptor name="interceptorThree" class="com.opensymphony.xwork2.config.providers.InterceptorForTestPurpose" />
|
||||
<interceptor-stack name="stackOne">
|
||||
<interceptor-ref name="interceptorOne"/>
|
||||
<interceptor-ref name="interceptorTwo"/>
|
||||
<interceptor-ref name="interceptorThree"/>
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="stackOne">
|
||||
<interceptor-ref name="interceptorOne" />
|
||||
<interceptor-ref name="interceptorTwo" />
|
||||
<interceptor-ref name="interceptorThree" />
|
||||
</interceptor-stack>
|
||||
<interceptor-stack name="stackTwo">
|
||||
<interceptor-ref name="stackOne"/>
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="stackTwo">
|
||||
<interceptor-ref name="stackOne" />
|
||||
</interceptor-stack>
|
||||
<interceptor-stack name="stackThree">
|
||||
<interceptor-ref name="stackTwo"/>
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="stackThree">
|
||||
<interceptor-ref name="stackTwo" />
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
|
||||
</interceptors>
|
||||
<action name="actionOne">
|
||||
<interceptor-ref name="stackTwo">
|
||||
<param name="stackOne.interceptorOne.paramOne">i1p1</param>
|
||||
<param name="stackOne.interceptorOne.paramTwo">i1p2</param>
|
||||
<param name="stackOne.interceptorTwo.paramOne">i2p1</param>
|
||||
</interceptor-ref>
|
||||
<result name="success" type="mock">test1</result>
|
||||
</action>
|
||||
|
||||
<action name="actionOne">
|
||||
<interceptor-ref name="stackTwo">
|
||||
<param name="stackOne.interceptorOne.paramOne">i1p1</param>
|
||||
<param name="stackOne.interceptorOne.paramTwo">i1p2</param>
|
||||
<param name="stackOne.interceptorTwo.paramOne">i2p1</param>
|
||||
</interceptor-ref>
|
||||
<result name="success" type="mock">test1</result>
|
||||
</action>
|
||||
|
||||
<action name="actionTwo">
|
||||
<interceptor-ref name="stackThree">
|
||||
<param name="stackTwo.stackOne.interceptorThree.paramOne">i3p1</param>
|
||||
<param name="stackTwo.stackOne.interceptorThree.paramTwo">i3p2</param>
|
||||
<param name="stackTwo.stackOne.interceptorTwo.paramTwo">i2p2</param>
|
||||
</interceptor-ref>
|
||||
<result name="success" type="mock">test2</result>
|
||||
</action>
|
||||
</package>
|
||||
</xwork>
|
||||
<action name="actionTwo">
|
||||
<interceptor-ref name="stackThree">
|
||||
<param name="stackTwo.stackOne.interceptorThree.paramOne">i3p1</param>
|
||||
<param name="stackTwo.stackOne.interceptorThree.paramTwo">i3p2</param>
|
||||
<param name="stackTwo.stackOne.interceptorTwo.paramTwo">i2p2</param>
|
||||
</interceptor-ref>
|
||||
<result name="success" type="mock">test2</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default">
|
||||
<interceptors>
|
||||
@@ -45,4 +43,4 @@
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+6
-8
@@ -19,16 +19,14 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml"/>
|
||||
<package name="default">
|
||||
<interceptors>
|
||||
<interceptor name="noop" class="noop-interceptor"/>
|
||||
</interceptors>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default">
|
||||
<result-types>
|
||||
@@ -62,5 +60,5 @@
|
||||
</action>
|
||||
</package>
|
||||
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default" namespace="/default">
|
||||
<action name="default" class="com.opensymphony.xwork2.ActionSupport"/>
|
||||
@@ -45,4 +43,4 @@
|
||||
<package name="multipleInheritance" namespace="/multiple" extends="default,abstractPackage,singleInheritance">
|
||||
<action name="multiple" class="com.opensymphony.xwork2.ActionSupport"/>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,13 +19,11 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.5//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.5.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
|
||||
<constant name="struts.configuration.xml.reload" value="true" />
|
||||
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default">
|
||||
<result-types>
|
||||
@@ -44,4 +42,4 @@
|
||||
<result name="subMockTypedResult" type="subMock" />
|
||||
</action>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.5//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.5.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default">
|
||||
<result-types>
|
||||
@@ -66,4 +64,4 @@
|
||||
<result name="input" />
|
||||
</action>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+51
-52
@@ -19,55 +19,54 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd">
|
||||
|
||||
<xwork>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="xworkResultTypesTestPackage1">
|
||||
<result-types>
|
||||
<result-type name="result1" class="com.opensymphony.xwork2.mock.MockResult" >
|
||||
<param name="param1">value1</param>
|
||||
<param name="param2">value2</param>
|
||||
<param name="param3">value3</param>
|
||||
</result-type>
|
||||
<result-type name="result2" class="com.opensymphony.xwork2.mock.MockResult">
|
||||
<param name="paramA">valueA</param>
|
||||
<param name="paramB">valueB</param>
|
||||
</result-type>
|
||||
</result-types>
|
||||
</package>
|
||||
|
||||
|
||||
<package name="xworkResultTypesTestPackage2">
|
||||
<result-types>
|
||||
<result-type name="result1" class="com.opensymphony.xwork2.mock.MockResult" >
|
||||
<param name="param1">value1</param>
|
||||
<param name="param2">value2</param>
|
||||
<param name="param3">value3</param>
|
||||
</result-type>
|
||||
<result-type name="result2" class="com.opensymphony.xwork2.mock.MockResult">
|
||||
<param name="paramA">valueA</param>
|
||||
<param name="paramB">valueB</param>
|
||||
</result-type>
|
||||
</result-types>
|
||||
|
||||
<action name="action1">
|
||||
<result name="success" type="result1">
|
||||
<param name="param1">newValue1</param>
|
||||
<param name="param3">newValue3</param>
|
||||
<param name="param10">value10</param>
|
||||
<param name="param11">value11</param>
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="action2">
|
||||
<result name="success" type="result2">
|
||||
<param name="paramB">newValueB</param>
|
||||
<param name="paramZ">valueZ</param>
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
</xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml"/>
|
||||
<package name="xworkResultTypesTestPackage1">
|
||||
<result-types>
|
||||
<result-type name="result1" class="com.opensymphony.xwork2.mock.MockResult">
|
||||
<param name="param1">value1</param>
|
||||
<param name="param2">value2</param>
|
||||
<param name="param3">value3</param>
|
||||
</result-type>
|
||||
<result-type name="result2" class="com.opensymphony.xwork2.mock.MockResult">
|
||||
<param name="paramA">valueA</param>
|
||||
<param name="paramB">valueB</param>
|
||||
</result-type>
|
||||
</result-types>
|
||||
</package>
|
||||
|
||||
|
||||
<package name="xworkResultTypesTestPackage2">
|
||||
<result-types>
|
||||
<result-type name="result1" class="com.opensymphony.xwork2.mock.MockResult">
|
||||
<param name="param1">value1</param>
|
||||
<param name="param2">value2</param>
|
||||
<param name="param3">value3</param>
|
||||
</result-type>
|
||||
<result-type name="result2" class="com.opensymphony.xwork2.mock.MockResult">
|
||||
<param name="paramA">valueA</param>
|
||||
<param name="paramB">valueB</param>
|
||||
</result-type>
|
||||
</result-types>
|
||||
|
||||
<action name="action1">
|
||||
<result name="success" type="result1">
|
||||
<param name="param1">newValue1</param>
|
||||
<param name="param3">newValue3</param>
|
||||
<param name="param10">value10</param>
|
||||
<param name="param11">value11</param>
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="action2">
|
||||
<result name="success" type="result2">
|
||||
<param name="paramB">newValueB</param>
|
||||
<param name="paramZ">valueZ</param>
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<package name="default">
|
||||
<result-types>
|
||||
@@ -50,4 +48,4 @@
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,11 +19,9 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<package name="default-1" />
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,11 +19,9 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<package name="default-2" />
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,15 +19,13 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<include file="xwork-test-beans.xml" />
|
||||
<include file="com/opensymphony/xwork2/config/providers/xwork-test-wildcard-*.xml" />
|
||||
<!-- config file defined inside xwork-jar.jar -->
|
||||
<include file="xwork-jar.xml" />
|
||||
<package name="default-wildcard" />
|
||||
</xwork>
|
||||
</struts>
|
||||
+5
-7
@@ -19,15 +19,13 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<bean type="com.opensymphony.xwork2.UnknownHandler" name="uh1" class="com.opensymphony.xwork2.config.providers.SomeUnknownHandler"/>
|
||||
<bean type="com.opensymphony.xwork2.UnknownHandler" name="uh2" class="com.opensymphony.xwork2.config.providers.SomeUnknownHandler"/>
|
||||
|
||||
<unknown-handler-stack>
|
||||
</unknown-handler-stack>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
+5
-7
@@ -19,12 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 2.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-2.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<bean type="com.opensymphony.xwork2.UnknownHandler" name="uh1" class="com.opensymphony.xwork2.config.providers.SomeUnknownHandler"/>
|
||||
<bean type="com.opensymphony.xwork2.UnknownHandler" name="uh2" class="com.opensymphony.xwork2.config.providers.SomeUnknownHandler"/>
|
||||
|
||||
@@ -32,4 +30,4 @@
|
||||
<unknown-handler-ref name="uh1" />
|
||||
<unknown-handler-ref name="uh2" />
|
||||
</unknown-handler-stack>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC "-//Apache Struts//XWork 2.0//EN" "http://struts.apache.org/dtds/xwork-2.0.dtd">
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<bean type="com.opensymphony.xwork2.ObjectFactory" class="com.opensymphony.xwork2.spring.SpringObjectFactory" />
|
||||
<constant name="applicationContextPath" value="com/opensymphony/xwork2/spring/actionContext-spring.xml" />
|
||||
<constant name="struts.disallowProxyMemberAccess" value="true" />
|
||||
@@ -65,4 +67,4 @@
|
||||
<result name="S2-047" type="null" />
|
||||
</action>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
@@ -19,25 +19,31 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC "-//Apache Struts//XWork 2.0//EN" "http://struts.apache.org/dtds/xwork-2.0.dtd">
|
||||
<xwork>
|
||||
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="default" class="com.opensymphony.xwork2.DefaultActionProxyFactory" />
|
||||
<bean type="com.opensymphony.xwork2.ObjectFactory" name="default" class="com.opensymphony.xwork2.spring.SpringObjectFactory" />
|
||||
<constant name="applicationContextPath" value="com/opensymphony/xwork2/spring/actionContext-spring.xml" />
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="default"
|
||||
class="com.opensymphony.xwork2.DefaultActionProxyFactory"/>
|
||||
<bean type="com.opensymphony.xwork2.ObjectFactory" name="default"
|
||||
class="com.opensymphony.xwork2.spring.SpringObjectFactory"/>
|
||||
<constant name="applicationContextPath" value="com/opensymphony/xwork2/spring/actionContext-spring.xml"/>
|
||||
<package name="default">
|
||||
<result-types>
|
||||
<result-type name="null"
|
||||
class="com.opensymphony.xwork2.result.NullResult" default="true"/>
|
||||
class="com.opensymphony.xwork2.result.NullResult" default="true"/>
|
||||
</result-types>
|
||||
|
||||
<interceptors>
|
||||
<interceptor name="autowire" class="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor">
|
||||
<param name="autowireStrategy">@org.springframework.beans.factory.config.AutowireCapableBeanFactory@AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE</param>
|
||||
<param name="autowireStrategy">
|
||||
@org.springframework.beans.factory.config.AutowireCapableBeanFactory@AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE
|
||||
</param>
|
||||
</interceptor>
|
||||
</interceptors>
|
||||
|
||||
<default-interceptor-ref name="autowire"/>
|
||||
|
||||
<action name="simpleAction" class="com.opensymphony.xwork2.SimpleAction"/>
|
||||
<action name="simpleAction" class="com.opensymphony.xwork2.SimpleAction"/>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
@@ -19,13 +19,11 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//Apache Struts//XWork 1.1.1//EN"
|
||||
"http://struts.apache.org/dtds/xwork-1.1.1.dtd"
|
||||
>
|
||||
|
||||
<xwork>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.5.dtd">
|
||||
<struts>
|
||||
<package name="includeTest" extends="default" namespace="includeTest">
|
||||
<action name="includeTest" class="com.opensymphony.xwork2.SimpleAction"></action>
|
||||
</package>
|
||||
</xwork>
|
||||
</struts>
|
||||
|
||||
@@ -20,6 +20,6 @@
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.6//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.6.dtd">
|
||||
<struts />
|
||||
@@ -21,8 +21,8 @@
|
||||
-->
|
||||
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.6//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.6.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user