mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
WW-4090 Add some logging
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_2_X@1488899 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -27,6 +27,8 @@ import com.opensymphony.xwork2.config.ConfigurationManager;
|
||||
import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.struts2.RequestUtils;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
@@ -157,6 +159,8 @@ import java.util.*;
|
||||
*/
|
||||
public class DefaultActionMapper implements ActionMapper {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DefaultActionMapper.class);
|
||||
|
||||
protected static final String METHOD_PREFIX = "method:";
|
||||
protected static final String ACTION_PREFIX = "action:";
|
||||
protected static final String REDIRECT_PREFIX = "redirect:";
|
||||
@@ -431,10 +435,17 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
if (rawActionName.matches(allowedActionNames)) {
|
||||
return rawActionName;
|
||||
} else {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Action [#0] do not match allowed action names pattern [#1], cleaning it up!",
|
||||
rawActionName, allowedActionNames);
|
||||
}
|
||||
String cleanActionName = rawActionName;
|
||||
for(String chunk : rawActionName.split(allowedActionNames)) {
|
||||
cleanActionName = cleanActionName.replace(chunk, "");
|
||||
}
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Cleaned action name [#0]", cleanActionName);
|
||||
}
|
||||
return cleanActionName;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user