Skip to content

Commit

Permalink
WW-4090 Add some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Jun 3, 2013
1 parent 54e5c91 commit 8b4fc81
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
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;
Expand Down Expand Up @@ -157,6 +159,8 @@
*/
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:";
Expand Down Expand Up @@ -431,10 +435,17 @@ protected String cleanupActionName(final String rawActionName) {
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;
}
}
Expand Down

0 comments on commit 8b4fc81

Please sign in to comment.