You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2013/06/03 10:51:22 UTC
svn commit: r1488899 -
/struts/struts2/branches/STRUTS_2_3_14_2_X/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
Author: lukaszlenart
Date: Mon Jun 3 08:51:22 2013
New Revision: 1488899
URL: http://svn.apache.org/r1488899
Log:
WW-4090 Add some logging
Modified:
struts/struts2/branches/STRUTS_2_3_14_2_X/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
Modified: struts/struts2/branches/STRUTS_2_3_14_2_X/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_3_14_2_X/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java?rev=1488899&r1=1488898&r2=1488899&view=diff
==============================================================================
--- struts/struts2/branches/STRUTS_2_3_14_2_X/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java (original)
+++ struts/struts2/branches/STRUTS_2_3_14_2_X/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java Mon Jun 3 08:51:22 2013
@@ -27,6 +27,8 @@ import com.opensymphony.xwork2.config.Co
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 impleme
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;
}
}