mirror of
https://github.com/apache/struts.git
synced 2026-09-11 00:29:40 +00:00
WW-3263 Convention does not check for "struts.enable.SlashesInActionNames"
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@818953 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+9
-2
@@ -101,6 +101,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
|
||||
private Set<String> fileProtocols;
|
||||
private boolean alwaysMapExecute;
|
||||
private boolean excludeParentClassLoader;
|
||||
private boolean slashesInActionNames;
|
||||
|
||||
private static final String DEFAULT_METHOD = "execute";
|
||||
|
||||
@@ -150,6 +151,12 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
|
||||
public void setReload(String reload) {
|
||||
this.reload = "true".equals(reload);
|
||||
}
|
||||
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_ENABLE_SLASHES_IN_ACTION_NAMES)
|
||||
public void setSlashesInActionNames(String slashesInActionNames) {
|
||||
this.slashesInActionNames = "true".equals(slashesInActionNames);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude URLs found by the parent class loader. Defaults to "true", set to true for JBoss
|
||||
@@ -578,7 +585,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
|
||||
List<Action> actions = map.get(method);
|
||||
for (Action action : actions) {
|
||||
PackageConfig.Builder pkgCfg = defaultPackageConfig;
|
||||
if (action.value().contains("/")) {
|
||||
if (action.value().contains("/") && !slashesInActionNames) {
|
||||
pkgCfg = getPackageConfig(packageConfigs, namespace, actionPackage,
|
||||
actionClass, action);
|
||||
}
|
||||
@@ -780,7 +787,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
|
||||
if (annotation != null) {
|
||||
actionName = annotation.value() != null && annotation.value().equals(Action.DEFAULT_VALUE) ?
|
||||
actionName : annotation.value();
|
||||
actionName = StringUtils.contains(actionName, "/") ? StringUtils.substringAfterLast(actionName, "/") : actionName;
|
||||
actionName = StringUtils.contains(actionName, "/") && !slashesInActionNames ? StringUtils.substringAfterLast(actionName, "/") : actionName;
|
||||
}
|
||||
|
||||
ActionConfig.Builder actionConfig = new ActionConfig.Builder(pkgCfg.getName(),
|
||||
|
||||
Reference in New Issue
Block a user