最严重的问题是,框架获取不到url中的action name,错误提示如下:
There is no Action mapped for namespace / and action name[index]
莫名其妙的index,然后我debug断点跟踪,后来发现了问题,先放上struts2-core中DefaultActionMapper.class中设置mapping中name的方法对比
版本2.3代码如下:
protected String cleanupActionName(String rawActionName)
{
if (this.allowedActionNames.matcher(rawActionName).matches()) {
return rawActionName;
}
if (LOG.isWarnEnabled()) {
LOG.warn("Action [#0] does not match allowed action names pattern [#1], cleaning it up!", new Object[] { rawActionName, this.allowedActionNames });
}
String cleanActionName = rawActionName;
for (String chunk : this.allowedActionNames.split(rawActionName)) {
cleanActionName = cleanActionName.replace(chunk,