mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
Puts back option to disable strict DMI
This commit is contained in:
@@ -448,6 +448,7 @@ public class PackageConfig extends Located implements Comparable, Serializable,
|
||||
public static class Builder implements InterceptorLocator {
|
||||
|
||||
protected PackageConfig target;
|
||||
private boolean strictDMI;
|
||||
|
||||
public Builder(String name) {
|
||||
target = new PackageConfig(name);
|
||||
@@ -613,6 +614,15 @@ public class PackageConfig extends Located implements Comparable, Serializable,
|
||||
return target.getAllInterceptorConfigs().get(name);
|
||||
}
|
||||
|
||||
public Builder strictMethodInvocation(boolean strict) {
|
||||
strictDMI = strict;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isStrictMethodInvocation() {
|
||||
return strictDMI;
|
||||
}
|
||||
|
||||
public PackageConfig build() {
|
||||
embalmTarget();
|
||||
PackageConfig result = target;
|
||||
|
||||
+3
@@ -649,9 +649,12 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
|
||||
String name = StringUtils.defaultString(packageElement.getAttribute("name"));
|
||||
String namespace = StringUtils.defaultString(packageElement.getAttribute("namespace"));
|
||||
|
||||
boolean strictDMI = Boolean.parseBoolean(packageElement.getAttribute("strict-method-invocation"));
|
||||
|
||||
PackageConfig.Builder cfg = new PackageConfig.Builder(name)
|
||||
.namespace(namespace)
|
||||
.isAbstract(isAbstract)
|
||||
.strictMethodInvocation(strictDMI)
|
||||
.location(DomHelper.getLocationObject(packageElement));
|
||||
|
||||
if (StringUtils.isNotEmpty(StringUtils.defaultString(parent))) { // has parents, let's look it up
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
strict-method-invocation (true|false) "true"
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
extends CDATA #IMPLIED
|
||||
namespace CDATA #IMPLIED
|
||||
abstract CDATA #IMPLIED
|
||||
strict-method-invocation (true|false) "true"
|
||||
>
|
||||
|
||||
<!ELEMENT result-types (result-type+)>
|
||||
|
||||
Reference in New Issue
Block a user