From cf10f68e766957fdd7f1bf70f25d4cc899a40b87 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Fri, 7 Jul 2017 10:23:54 +0200 Subject: [PATCH 1/7] Extends action suffix to support multiple suffixes --- .../PackageBasedActionConfigBuilder.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java index 25083e279..b244392d2 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java @@ -75,7 +75,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { private String packageLocatorsBasePackage; private boolean disableActionScanning = false; private boolean disablePackageLocatorsScanning = false; - private String actionSuffix = "Action"; + private Set actionSuffix = Collections.singleton("Action"); private boolean checkImplementsAction = true; private boolean mapAllMatches = false; private Set loadedFileUrls = new HashSet<>(); @@ -227,7 +227,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { @Inject(value = "struts.convention.action.suffix", required = false) public void setActionSuffix(String actionSuffix) { if (StringUtils.isNotBlank(actionSuffix)) { - this.actionSuffix = actionSuffix; + this.actionSuffix = TextParseUtil.commaDelimitedStringToSet(actionSuffix); } } @@ -615,7 +615,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { // such as com.opensymphony.xwork2.ActionSupport. We repeat the // package filter here to filter out such results. boolean inPackage = includeClassNameInActionScan(classInfo.getName()); - boolean nameMatches = classInfo.getName().endsWith(actionSuffix); + boolean nameMatches = matchesSuffix(classInfo.getName()); try { return inPackage && (nameMatches || (checkImplementsAction && com.opensymphony.xwork2.Action.class.isAssignableFrom(classInfo.get()))); @@ -624,6 +624,15 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { return false; } } + + private boolean matchesSuffix(String name) { + for (String suffix : actionSuffix) { + if (name.endsWith(suffix)) { + return true; + } + } + return false; + } }; } From b708d844c292e064f5ef90bf65bfcd53b32b6659 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Fri, 7 Jul 2017 10:24:02 +0200 Subject: [PATCH 2/7] Uses multiple suffixes --- .../convention/DefaultActionNameBuilder.java | 22 +++++++++--- .../convention/SEOActionNameBuilder.java | 36 ++++++++++++++----- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java index 46b21693d..97199703a 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java @@ -21,8 +21,12 @@ package org.apache.struts2.convention; import com.opensymphony.xwork2.inject.Inject; +import com.opensymphony.xwork2.util.TextParseUtil; import org.apache.commons.lang3.StringUtils; +import java.util.Collections; +import java.util.Set; + /** *

* This class strips the word Action from the end of the class name @@ -33,7 +37,7 @@ import org.apache.commons.lang3.StringUtils; *

*/ public class DefaultActionNameBuilder implements ActionNameBuilder { - private String actionSuffix = "Action"; + private Set actionSuffix = Collections.singleton("Action"); private boolean lowerCase; @Inject @@ -48,7 +52,7 @@ public class DefaultActionNameBuilder implements ActionNameBuilder { @Inject(value = "struts.convention.action.suffix", required = false) public void setActionSuffix(String actionSuffix) { if (StringUtils.isNotBlank(actionSuffix)) { - this.actionSuffix = actionSuffix; + this.actionSuffix = TextParseUtil.commaDelimitedStringToSet(actionSuffix); } } @@ -56,9 +60,7 @@ public class DefaultActionNameBuilder implements ActionNameBuilder { String actionName = className; // Truncate Action suffix if found - if (actionName.endsWith(actionSuffix)) { - actionName = actionName.substring(0, actionName.length() - actionSuffix.length()); - } + actionName = truncateSuffixIfMatches(actionName); // Force initial letter of action to lowercase, if desired if ((lowerCase) && (actionName.length() > 1)) { @@ -72,4 +74,14 @@ public class DefaultActionNameBuilder implements ActionNameBuilder { return actionName; } + + private String truncateSuffixIfMatches(String name) { + String actionName = name; + for (String suffix : actionSuffix) { + if (actionName.endsWith(suffix)) { + actionName = actionName.substring(0, actionName.length() - suffix.length()); + } + } + return actionName; + } } \ No newline at end of file diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java index f2920c018..490476d2c 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java @@ -21,10 +21,14 @@ package org.apache.struts2.convention; import com.opensymphony.xwork2.inject.Inject; +import com.opensymphony.xwork2.util.TextParseUtil; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; import org.apache.commons.lang3.StringUtils; +import java.util.Collections; +import java.util.Set; + /** *

* This class converts the class name into a SEO friendly name by recognizing @@ -35,7 +39,7 @@ import org.apache.commons.lang3.StringUtils; */ public class SEOActionNameBuilder implements ActionNameBuilder { private static final Logger LOG = LogManager.getLogger(SEOActionNameBuilder.class); - private String actionSuffix = "Action"; + private Set actionSuffix = Collections.singleton("Action"); private boolean lowerCase; private String separator; @@ -53,20 +57,17 @@ public class SEOActionNameBuilder implements ActionNameBuilder { @Inject(value = "struts.convention.action.suffix", required = false) public void setActionSuffix(String actionSuffix) { if (StringUtils.isNotBlank(actionSuffix)) { - this.actionSuffix = actionSuffix; + this.actionSuffix = TextParseUtil.commaDelimitedStringToSet(actionSuffix); } } public String build(String className) { String actionName = className; - - if (actionName.equals(actionSuffix)) - throw new IllegalStateException("The action name cannot be the same as the action suffix [" + actionSuffix + "]"); + + checkActionName(actionName); // Truncate Action suffix if found - if (actionName.endsWith(actionSuffix)) { - actionName = actionName.substring(0, actionName.length() - actionSuffix.length()); - } + actionName = truncateSuffixIfMatches(actionName); // Convert to underscores char[] ca = actionName.toCharArray(); @@ -93,4 +94,23 @@ public class SEOActionNameBuilder implements ActionNameBuilder { return actionName; } + + void checkActionName(String actionName) { + for (String suffix : actionSuffix) { + if (actionName.equals(suffix)) { + throw new IllegalStateException("The action name cannot be the same as the action suffix [" + suffix + "]"); + } + } + } + + private String truncateSuffixIfMatches(String name) { + String actionName = name; + for (String suffix : actionSuffix) { + if (actionName.endsWith(suffix)) { + actionName = actionName.substring(0, actionName.length() - suffix.length()); + } + } + return actionName; + } + } \ No newline at end of file From f522fbc45417b836463553e3d9110ee58fcf2673 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Fri, 7 Jul 2017 10:58:26 +0200 Subject: [PATCH 3/7] Extract common code --- .../convention/AbstractActionNameBuilder.java | 44 ++++++++++++++++++ .../convention/ConventionConstants.java | 2 + .../convention/DefaultActionNameBuilder.java | 35 +++------------ .../convention/SEOActionNameBuilder.java | 45 +++---------------- 4 files changed, 60 insertions(+), 66 deletions(-) create mode 100644 plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java new file mode 100644 index 000000000..a546e62fa --- /dev/null +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java @@ -0,0 +1,44 @@ +package org.apache.struts2.convention; + +import com.opensymphony.xwork2.inject.Inject; +import com.opensymphony.xwork2.util.TextParseUtil; +import org.apache.commons.lang3.StringUtils; + +import java.util.Collections; +import java.util.Set; + +public abstract class AbstractActionNameBuilder implements ActionNameBuilder { + + private Set actionSuffix = Collections.singleton("Action"); + + /** + * @param actionSuffix (Optional) Classes that end with these value will be mapped as actions + * (defaults to "Action") + */ + @Inject(value = "struts.convention.action.suffix", required = false) + public void setActionSuffix(String actionSuffix) { + if (StringUtils.isNotBlank(actionSuffix)) { + this.actionSuffix = TextParseUtil.commaDelimitedStringToSet(actionSuffix); + } + } + + + protected void checkActionName(String actionName) { + for (String suffix : actionSuffix) { + if (actionName.equals(suffix)) { + throw new IllegalStateException("The action name cannot be the same as the action suffix [" + suffix + "]"); + } + } + } + + protected String truncateSuffixIfMatches(String name) { + String actionName = name; + for (String suffix : actionSuffix) { + if (actionName.endsWith(suffix)) { + actionName = actionName.substring(0, actionName.length() - suffix.length()); + } + } + return actionName; + } + +} diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java index 2842b8ce1..b360d946e 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java @@ -29,4 +29,6 @@ public class ConventionConstants { public static final String CONVENTION_RESULT_MAP_BUILDER = "struts.convention.resultMapBuilder"; public static final String CONVENTION_INTERCEPTOR_MAP_BUILDER = "struts.convention.interceptorMapBuilder"; public static final String CONVENTION_CONVENTIONS_SERVICE = "struts.convention.conventionsService"; + public static final String CONVENTION_ACTION_NAME_LOWERCASE = "struts.convention.action.name.lowercase"; + public static final String CONVENTION_ACTION_NAME_SEPARATOR = "struts.convention.action.name.separator"; } diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java index 97199703a..797a51950 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java @@ -21,11 +21,6 @@ package org.apache.struts2.convention; import com.opensymphony.xwork2.inject.Inject; -import com.opensymphony.xwork2.util.TextParseUtil; -import org.apache.commons.lang3.StringUtils; - -import java.util.Collections; -import java.util.Set; /** *

@@ -36,29 +31,22 @@ import java.util.Set; * action names. *

*/ -public class DefaultActionNameBuilder implements ActionNameBuilder { - private Set actionSuffix = Collections.singleton("Action"); +public class DefaultActionNameBuilder extends AbstractActionNameBuilder { + private boolean lowerCase; @Inject - public DefaultActionNameBuilder(@Inject(value="struts.convention.action.name.lowercase") String lowerCase) { + public DefaultActionNameBuilder( + @Inject(ConventionConstants.CONVENTION_ACTION_NAME_LOWERCASE) String lowerCase + ) { this.lowerCase = Boolean.parseBoolean(lowerCase); } - /** - * @param actionSuffix (Optional) Classes that end with these value will be mapped as actions - * (defaults to "Action") - */ - @Inject(value = "struts.convention.action.suffix", required = false) - public void setActionSuffix(String actionSuffix) { - if (StringUtils.isNotBlank(actionSuffix)) { - this.actionSuffix = TextParseUtil.commaDelimitedStringToSet(actionSuffix); - } - } - public String build(String className) { String actionName = className; + checkActionName(actionName); + // Truncate Action suffix if found actionName = truncateSuffixIfMatches(actionName); @@ -75,13 +63,4 @@ public class DefaultActionNameBuilder implements ActionNameBuilder { return actionName; } - private String truncateSuffixIfMatches(String name) { - String actionName = name; - for (String suffix : actionSuffix) { - if (actionName.endsWith(suffix)) { - actionName = actionName.substring(0, actionName.length() - suffix.length()); - } - } - return actionName; - } } \ No newline at end of file diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java index 490476d2c..3fea36ae5 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java @@ -21,13 +21,8 @@ package org.apache.struts2.convention; import com.opensymphony.xwork2.inject.Inject; -import com.opensymphony.xwork2.util.TextParseUtil; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; -import org.apache.commons.lang3.StringUtils; - -import java.util.Collections; -import java.util.Set; /** *

@@ -37,30 +32,22 @@ import java.util.Set; * from the class name. *

*/ -public class SEOActionNameBuilder implements ActionNameBuilder { +public class SEOActionNameBuilder extends AbstractActionNameBuilder { + private static final Logger LOG = LogManager.getLogger(SEOActionNameBuilder.class); - private Set actionSuffix = Collections.singleton("Action"); + private boolean lowerCase; private String separator; @Inject - public SEOActionNameBuilder(@Inject(value="struts.convention.action.name.lowercase") String lowerCase, - @Inject(value="struts.convention.action.name.separator") String separator) { + public SEOActionNameBuilder( + @Inject(ConventionConstants.CONVENTION_ACTION_NAME_LOWERCASE) String lowerCase, + @Inject(ConventionConstants.CONVENTION_ACTION_NAME_SEPARATOR) String separator + ) { this.lowerCase = Boolean.parseBoolean(lowerCase); this.separator = separator; } - /** - * @param actionSuffix (Optional) Classes that end with these value will be mapped as actions - * (defaults to "Action") - */ - @Inject(value = "struts.convention.action.suffix", required = false) - public void setActionSuffix(String actionSuffix) { - if (StringUtils.isNotBlank(actionSuffix)) { - this.actionSuffix = TextParseUtil.commaDelimitedStringToSet(actionSuffix); - } - } - public String build(String className) { String actionName = className; @@ -95,22 +82,4 @@ public class SEOActionNameBuilder implements ActionNameBuilder { return actionName; } - void checkActionName(String actionName) { - for (String suffix : actionSuffix) { - if (actionName.equals(suffix)) { - throw new IllegalStateException("The action name cannot be the same as the action suffix [" + suffix + "]"); - } - } - } - - private String truncateSuffixIfMatches(String name) { - String actionName = name; - for (String suffix : actionSuffix) { - if (actionName.endsWith(suffix)) { - actionName = actionName.substring(0, actionName.length() - suffix.length()); - } - } - return actionName; - } - } \ No newline at end of file From b5be431f540271685eed803c7e55bf5a4d3138e6 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Fri, 7 Jul 2017 11:01:03 +0200 Subject: [PATCH 4/7] Converts comments into logging statements --- .../convention/DefaultActionNameBuilder.java | 16 +++++++++------- .../struts2/convention/SEOActionNameBuilder.java | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java index 797a51950..8a220b850 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java @@ -21,6 +21,8 @@ package org.apache.struts2.convention; import com.opensymphony.xwork2.inject.Inject; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; /** *

@@ -33,6 +35,8 @@ import com.opensymphony.xwork2.inject.Inject; */ public class DefaultActionNameBuilder extends AbstractActionNameBuilder { + private static final Logger LOG = LogManager.getLogger(DefaultActionNameBuilder.class); + private boolean lowerCase; @Inject @@ -47,17 +51,15 @@ public class DefaultActionNameBuilder extends AbstractActionNameBuilder { checkActionName(actionName); - // Truncate Action suffix if found + LOG.trace("Truncate Action suffix if found"); actionName = truncateSuffixIfMatches(actionName); - // Force initial letter of action to lowercase, if desired + LOG.trace("Force initial letter of action to lowercase, if desired"); if ((lowerCase) && (actionName.length() > 1)) { int lowerPos = actionName.lastIndexOf('/') + 1; - StringBuilder sb = new StringBuilder(); - sb.append(actionName.substring(0, lowerPos)); - sb.append(Character.toLowerCase(actionName.charAt(lowerPos))); - sb.append(actionName.substring(lowerPos + 1)); - actionName = sb.toString(); + actionName = actionName.substring(0, lowerPos) + + Character.toLowerCase(actionName.charAt(lowerPos)) + + actionName.substring(lowerPos + 1); } return actionName; diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java index 3fea36ae5..d96fd2d74 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java @@ -53,10 +53,10 @@ public class SEOActionNameBuilder extends AbstractActionNameBuilder { checkActionName(actionName); - // Truncate Action suffix if found + LOG.trace("Truncate Action suffix if found"); actionName = truncateSuffixIfMatches(actionName); - // Convert to underscores + LOG.trace("Convert to underscores"); char[] ca = actionName.toCharArray(); StringBuilder build = new StringBuilder("" + ca[0]); boolean lower = true; From f585d7920ebdd2ce5b7164b5425d4567dddeddcb Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Fri, 7 Jul 2017 11:13:44 +0200 Subject: [PATCH 5/7] Extracts constants --- .../convention/AbstractActionNameBuilder.java | 2 +- .../ClasspathConfigurationProvider.java | 2 +- .../convention/ConventionConstants.java | 20 +++++++++++ .../convention/ConventionUnknownHandler.java | 6 ++-- .../convention/ConventionsServiceImpl.java | 2 +- .../convention/DefaultResultMapBuilder.java | 4 +-- .../PackageBasedActionConfigBuilder.java | 34 +++++++++---------- 7 files changed, 45 insertions(+), 25 deletions(-) diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java index a546e62fa..df2214f1f 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java @@ -15,7 +15,7 @@ public abstract class AbstractActionNameBuilder implements ActionNameBuilder { * @param actionSuffix (Optional) Classes that end with these value will be mapped as actions * (defaults to "Action") */ - @Inject(value = "struts.convention.action.suffix", required = false) + @Inject(value = ConventionConstants.CONVENTION_ACTION_SUFFIX, required = false) public void setActionSuffix(String actionSuffix) { if (StringUtils.isNotBlank(actionSuffix)) { this.actionSuffix = TextParseUtil.commaDelimitedStringToSet(actionSuffix); diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathConfigurationProvider.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathConfigurationProvider.java index 32aec9699..79334e7c3 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathConfigurationProvider.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathConfigurationProvider.java @@ -53,7 +53,7 @@ public class ClasspathConfigurationProvider implements ConfigurationProvider, Di this.devMode = BooleanUtils.toBoolean(mode); } - @Inject("struts.convention.classes.reload") + @Inject(ConventionConstants.CONVENTION_CLASSES_RELOAD) public void setReload(String reload) { this.reload = BooleanUtils.toBoolean(reload); } diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java index b360d946e..ad5f4e8ef 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java @@ -31,4 +31,24 @@ public class ConventionConstants { public static final String CONVENTION_CONVENTIONS_SERVICE = "struts.convention.conventionsService"; public static final String CONVENTION_ACTION_NAME_LOWERCASE = "struts.convention.action.name.lowercase"; public static final String CONVENTION_ACTION_NAME_SEPARATOR = "struts.convention.action.name.separator"; + public static final String CONVENTION_ACTION_SUFFIX = "struts.convention.action.suffix"; + public static final String CONVENTION_CLASSES_RELOAD = "struts.convention.classes.reload"; + public static final String CONVENTION_RESULT_PATH = "struts.convention.result.path"; + public static final String CONVENTION_DEFAULT_PARENT_PACKAGE = "struts.convention.default.parent.package"; + public static final String CONVENTION_REDIRECT_TO_SLASH = "struts.convention.redirect.to.slash"; + public static final String CONVENTION_RELATIVE_RESULT_TYPES = "struts.convention.relative.result.types"; + public static final String CONVENTION_EXCLUDE_PARENT_CLASS_LOADER = "struts.convention.exclude.parentClassLoader"; + public static final String CONVENTION_ACTION_ALWAYS_MAP_EXECUTE = "struts.convention.action.alwaysMapExecute"; + public static final String CONVENTION_ACTION_FILE_PROTOCOLS = "struts.convention.action.fileProtocols"; + public static final String CONVENTION_ACTION_DISABLE_SCANNING = "struts.convention.action.disableScanning"; + public static final String CONVENTION_ACTION_INCLUDE_JARS = "struts.convention.action.includeJars"; + public static final String CONVENTION_PACKAGE_LOCATORS_DISABLE = "struts.convention.package.locators.disable"; + public static final String CONVENTION_ACTION_PACKAGES = "struts.convention.action.packages"; + public static final String CONVENTION_ACTION_CHECK_IMPLEMENTS_ACTION = "struts.convention.action.checkImplementsAction"; + public static final String CONVENTION_EXCLUDE_PACKAGES = "struts.convention.exclude.packages"; + public static final String CONVENTION_PACKAGE_LOCATORS = "struts.convention.package.locators"; + public static final String CONVENTION_PACKAGE_LOCATORS_BASE_PACKAGE = "struts.convention.package.locators.basePackage"; + public static final String CONVENTION_ACTION_MAP_ALL_MATCHES = "struts.convention.action.mapAllMatches"; + public static final String CONVENTION_ACTION_EAGER_LOADING = "struts.convention.action.eagerLoading"; + public static final String CONVENTION_RESULT_FLAT_LAYOUT = "struts.convention.result.flatLayout"; } diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionUnknownHandler.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionUnknownHandler.java index cb10f1b48..8e87494d6 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionUnknownHandler.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionUnknownHandler.java @@ -94,9 +94,9 @@ public class ConventionUnknownHandler implements UnknownHandler { @Inject public ConventionUnknownHandler(Configuration configuration, ObjectFactory objectFactory, ServletContext servletContext, Container container, - @Inject("struts.convention.default.parent.package") String defaultParentPackageName, - @Inject("struts.convention.redirect.to.slash") String redirectToSlash, - @Inject("struts.convention.action.name.separator") String nameSeparator) { + @Inject(ConventionConstants.CONVENTION_DEFAULT_PARENT_PACKAGE) String defaultParentPackageName, + @Inject(ConventionConstants.CONVENTION_REDIRECT_TO_SLASH) String redirectToSlash, + @Inject(ConventionConstants.CONVENTION_ACTION_NAME_SEPARATOR) String nameSeparator) { this.configuration = configuration; this.objectFactory = objectFactory; this.servletContext = servletContext; diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java index 8e6853854..004b28ef3 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java @@ -49,7 +49,7 @@ public class ConventionsServiceImpl implements ConventionsService { * the constant name of struts.convention.result.path. */ @Inject - public ConventionsServiceImpl(@Inject("struts.convention.result.path") String resultPath) { + public ConventionsServiceImpl(@Inject(ConventionConstants.CONVENTION_RESULT_PATH) String resultPath) { this.resultPath = resultPath; } diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultResultMapBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultResultMapBuilder.java index 40ea279cd..724c09f9f 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultResultMapBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultResultMapBuilder.java @@ -131,7 +131,7 @@ public class DefaultResultMapBuilder implements ResultMapBuilder { */ @Inject public DefaultResultMapBuilder(ServletContext servletContext, Container container, - @Inject("struts.convention.relative.result.types") String relativeResultTypes) { + @Inject(ConventionConstants.CONVENTION_RELATIVE_RESULT_TYPES) String relativeResultTypes) { this.servletContext = servletContext; this.relativeResultTypes = new HashSet<>(Arrays.asList(relativeResultTypes.split("\\s*[,]\\s*"))); this.conventionsService = container.getInstance(ConventionsService.class, container.getInstance(String.class, ConventionConstants.CONVENTION_CONVENTIONS_SERVICE)); @@ -142,7 +142,7 @@ public class DefaultResultMapBuilder implements ResultMapBuilder { * ${namespace}/${actionName}-${result}.${extension}, otherwise in the form * ${namespace}/${actionName}/${result}.${extension} */ - @Inject("struts.convention.result.flatLayout") + @Inject(ConventionConstants.CONVENTION_RESULT_FLAT_LAYOUT) public void setFlatResultLayout(String flatResultLayout) { this.flatResultLayout = BooleanUtils.toBoolean(flatResultLayout); } diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java index b244392d2..d45f7bf98 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java @@ -108,8 +108,8 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { */ @Inject public PackageBasedActionConfigBuilder(Configuration configuration, Container container, ObjectFactory objectFactory, - @Inject("struts.convention.redirect.to.slash") String redirectToSlash, - @Inject("struts.convention.default.parent.package") String defaultParentPackage) { + @Inject(ConventionConstants.CONVENTION_REDIRECT_TO_SLASH) String redirectToSlash, + @Inject(ConventionConstants.CONVENTION_DEFAULT_PARENT_PACKAGE) String defaultParentPackage) { // Validate that the parameters are okay this.configuration = configuration; @@ -135,7 +135,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { * @param reload Reload configuration when classes change. Defaults to "false" and should not be used * in production. */ - @Inject("struts.convention.classes.reload") + @Inject(ConventionConstants.CONVENTION_CLASSES_RELOAD) public void setReload(String reload) { this.reload = BooleanUtils.toBoolean(reload); } @@ -149,7 +149,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { /** * @param exclude Exclude URLs found by the parent class loader. Defaults to "true", set to true for JBoss */ - @Inject("struts.convention.exclude.parentClassLoader") + @Inject(ConventionConstants.CONVENTION_EXCLUDE_PARENT_CLASS_LOADER) public void setExcludeParentClassLoader(String exclude) { this.excludeParentClassLoader = BooleanUtils.toBoolean(exclude); } @@ -158,7 +158,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { * @param alwaysMapExecute If this constant is true, and there is an "execute" method(not annotated), a mapping will be added * pointing to it, even if there are other mapping in the class */ - @Inject("struts.convention.action.alwaysMapExecute") + @Inject(ConventionConstants.CONVENTION_ACTION_ALWAYS_MAP_EXECUTE) public void setAlwaysMapExecute(String alwaysMapExecute) { this.alwaysMapExecute = BooleanUtils.toBoolean(alwaysMapExecute); } @@ -167,7 +167,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { * File URLs whose protocol are in these list will be processed as jars containing classes * @param fileProtocols Comma separated list of file protocols that will be considered as jar files and scanned */ - @Inject("struts.convention.action.fileProtocols") + @Inject(ConventionConstants.CONVENTION_ACTION_FILE_PROTOCOLS) public void setFileProtocols(String fileProtocols) { if (StringUtils.isNotBlank(fileProtocols)) { this.fileProtocols = TextParseUtil.commaDelimitedStringToSet(fileProtocols); @@ -177,7 +177,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { /** * @param disableActionScanning Disable scanning for actions */ - @Inject(value = "struts.convention.action.disableScanning", required = false) + @Inject(value = ConventionConstants.CONVENTION_ACTION_DISABLE_SCANNING, required = false) public void setDisableActionScanning(String disableActionScanning) { this.disableActionScanning = BooleanUtils.toBoolean(disableActionScanning); } @@ -185,7 +185,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { /** * @param includeJars Comma separated list of regular expressions of jars to be included. */ - @Inject(value = "struts.convention.action.includeJars", required = false) + @Inject(value = ConventionConstants.CONVENTION_ACTION_INCLUDE_JARS, required = false) public void setIncludeJars(String includeJars) { if (StringUtils.isNotEmpty(includeJars)) { this.includeJars = includeJars.split("\\s*[,]\\s*"); @@ -195,7 +195,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { /** * @param disablePackageLocatorsScanning If set to true, only the named packages will be scanned */ - @Inject(value = "struts.convention.package.locators.disable", required = false) + @Inject(value = ConventionConstants.CONVENTION_PACKAGE_LOCATORS_DISABLE, required = false) public void setDisablePackageLocatorsScanning(String disablePackageLocatorsScanning) { this.disablePackageLocatorsScanning = BooleanUtils.toBoolean(disablePackageLocatorsScanning); } @@ -204,7 +204,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { * @param actionPackages (Optional) An optional list of action packages that this should create * configuration for. */ - @Inject(value = "struts.convention.action.packages", required = false) + @Inject(value = ConventionConstants.CONVENTION_ACTION_PACKAGES, required = false) public void setActionPackages(String actionPackages) { if (StringUtils.isNotBlank(actionPackages)) { this.actionPackages = actionPackages.split("\\s*[,]\\s*"); @@ -215,7 +215,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { * @param checkImplementsAction (Optional) Map classes that implement com.opensymphony.xwork2.Action * as actions */ - @Inject(value = "struts.convention.action.checkImplementsAction", required = false) + @Inject(value = ConventionConstants.CONVENTION_ACTION_CHECK_IMPLEMENTS_ACTION, required = false) public void setCheckImplementsAction(String checkImplementsAction) { this.checkImplementsAction = BooleanUtils.toBoolean(checkImplementsAction); } @@ -224,7 +224,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { * @param actionSuffix (Optional) Classes that end with these value will be mapped as actions * (defaults to "Action") */ - @Inject(value = "struts.convention.action.suffix", required = false) + @Inject(value = ConventionConstants.CONVENTION_ACTION_SUFFIX, required = false) public void setActionSuffix(String actionSuffix) { if (StringUtils.isNotBlank(actionSuffix)) { this.actionSuffix = TextParseUtil.commaDelimitedStringToSet(actionSuffix); @@ -235,7 +235,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { * @param excludePackages (Optional) A list of packages that should be skipped when building * configuration. */ - @Inject(value = "struts.convention.exclude.packages", required = false) + @Inject(value = ConventionConstants.CONVENTION_EXCLUDE_PACKAGES, required = false) public void setExcludePackages(String excludePackages) { if (StringUtils.isNotBlank(excludePackages)) { this.excludePackages = excludePackages.split("\\s*[,]\\s*"); @@ -245,7 +245,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { /** * @param packageLocators (Optional) A list of names used to find action packages. */ - @Inject(value = "struts.convention.package.locators", required = false) + @Inject(value = ConventionConstants.CONVENTION_PACKAGE_LOCATORS, required = false) public void setPackageLocators(String packageLocators) { this.packageLocators = packageLocators.split("\\s*[,]\\s*"); } @@ -254,7 +254,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { * @param packageLocatorsBasePackage (Optional) If set, only packages that start with this * name will be scanned for actions. */ - @Inject(value = "struts.convention.package.locators.basePackage", required = false) + @Inject(value = ConventionConstants.CONVENTION_PACKAGE_LOCATORS_BASE_PACKAGE, required = false) public void setPackageLocatorsBase(String packageLocatorsBasePackage) { this.packageLocatorsBasePackage = packageLocatorsBasePackage; } @@ -264,7 +264,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { * even if they don't have a default method. The mapping from * the url to the action will be delegated the action mapper. */ - @Inject(value = "struts.convention.action.mapAllMatches", required = false) + @Inject(value = ConventionConstants.CONVENTION_ACTION_MAP_ALL_MATCHES, required = false) public void setMapAllMatches(String mapAllMatches) { this.mapAllMatches = BooleanUtils.toBoolean(mapAllMatches); } @@ -273,7 +273,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder { * @param eagerLoading (Optional) If set, found action classes will be instantiated by the ObjectFactory to accelerate future use * setting it up can clash with Spring managed beans */ - @Inject(value = "struts.convention.action.eagerLoading", required = false) + @Inject(value = ConventionConstants.CONVENTION_ACTION_EAGER_LOADING, required = false) public void setEagerLoading(String eagerLoading) { this.eagerLoading = BooleanUtils.toBoolean(eagerLoading); } From 89d9342e53c167fadc883afd81c1f81443e28c24 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Fri, 7 Jul 2017 11:28:14 +0200 Subject: [PATCH 6/7] Fixes small typo --- .../java/org/apache/struts2/convention/ConventionConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java index ad5f4e8ef..3d8c74d68 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java @@ -21,7 +21,7 @@ package org.apache.struts2.convention; /** - * Constants used to extend the COnvention plugin + * Constants used to extend the Convention plugin */ public class ConventionConstants { public static final String CONVENTION_ACTION_CONFIG_BUILDER = "struts.convention.actionConfigBuilder"; From 855be0e36c0ac07e36bb027750ae6ddf20dfbfee Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Fri, 7 Jul 2017 11:31:45 +0200 Subject: [PATCH 7/7] Updates header with license --- .../convention/AbstractActionNameBuilder.java | 19 ++++++++++++ .../convention/ActionConfigBuilder.java | 2 -- .../struts2/convention/ActionNameBuilder.java | 2 -- .../ClasspathConfigurationProvider.java | 2 -- .../convention/ClasspathPackageProvider.java | 5 ++-- .../convention/ConventionConstants.java | 2 -- .../convention/ConventionUnknownHandler.java | 2 -- .../convention/ConventionsService.java | 2 -- .../convention/ConventionsServiceImpl.java | 2 -- .../convention/DefaultActionNameBuilder.java | 2 -- .../convention/DefaultClassFinder.java | 29 ++++++++++--------- .../DefaultInterceptorMapBuilder.java | 2 -- .../convention/DefaultResultMapBuilder.java | 2 -- .../convention/InterceptorMapBuilder.java | 2 -- .../PackageBasedActionConfigBuilder.java | 2 -- .../struts2/convention/ReflectionTools.java | 2 -- .../struts2/convention/ResultMapBuilder.java | 2 -- .../convention/SEOActionNameBuilder.java | 2 -- .../struts2/convention/StringTools.java | 2 -- 19 files changed, 37 insertions(+), 48 deletions(-) diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java index df2214f1f..333b293ae 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/AbstractActionNameBuilder.java @@ -1,3 +1,22 @@ +/* + * 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. + */ + package org.apache.struts2.convention; import com.opensymphony.xwork2.inject.Inject; diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ActionConfigBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ActionConfigBuilder.java index 0d45590a8..89a9832de 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ActionConfigBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ActionConfigBuilder.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ActionNameBuilder.java index 89444053d..e9f41e3ce 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ActionNameBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ActionNameBuilder.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathConfigurationProvider.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathConfigurationProvider.java index 79334e7c3..f3d873322 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathConfigurationProvider.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathConfigurationProvider.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathPackageProvider.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathPackageProvider.java index 3d76cd9ed..7b314c05b 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathPackageProvider.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ClasspathPackageProvider.java @@ -1,6 +1,4 @@ /* - * $Id: ClasspathConfigurationProvider.java 655902 2008-05-13 15:15:12Z bpontarelli $ - * * 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 @@ -17,7 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - */package org.apache.struts2.convention; + */ +package org.apache.struts2.convention; import com.opensymphony.xwork2.config.PackageProvider; import com.opensymphony.xwork2.config.Configuration; diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java index 3d8c74d68..46ec9d46c 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionConstants.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionUnknownHandler.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionUnknownHandler.java index 8e87494d6..3ad275d96 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionUnknownHandler.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionUnknownHandler.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsService.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsService.java index 0b9d17ad1..3548c9d4c 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsService.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsService.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java index 004b28ef3..81dd0d398 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java index 8a220b850..46d6797af 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultActionNameBuilder.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultClassFinder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultClassFinder.java index 9412f7e0c..bd947f7b8 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultClassFinder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultClassFinder.java @@ -1,17 +1,20 @@ /* - * Copyright 2002-2003,2009 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 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. */ package org.apache.struts2.convention; diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java index 6ebce88a1..013421aa9 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultResultMapBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultResultMapBuilder.java index 724c09f9f..395b35028 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultResultMapBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultResultMapBuilder.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/InterceptorMapBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/InterceptorMapBuilder.java index c57235f5f..5f2d0a4fb 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/InterceptorMapBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/InterceptorMapBuilder.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java index d45f7bf98..31f088d38 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ReflectionTools.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ReflectionTools.java index 3db532739..6629a2b52 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ReflectionTools.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ReflectionTools.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/ResultMapBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/ResultMapBuilder.java index 1457aac9f..b120c0cc1 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/ResultMapBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/ResultMapBuilder.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java b/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java index d96fd2d74..1f23ba861 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/SEOActionNameBuilder.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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 diff --git a/plugins/convention/src/main/java/org/apache/struts2/convention/StringTools.java b/plugins/convention/src/main/java/org/apache/struts2/convention/StringTools.java index dbe53bb61..b24deeca1 100644 --- a/plugins/convention/src/main/java/org/apache/struts2/convention/StringTools.java +++ b/plugins/convention/src/main/java/org/apache/struts2/convention/StringTools.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * 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