错误信息类似如下两图所示:
1、检查struts.xml文件命名是否正确。 struts.xml文件必须命名为struts.xml。
2、检查struts.xml文件内容是否正确。如name,namespace,extends,class等。
3、检查jsp页面是否使用动态调用。 index.jsp或者其他页面如果有<s:a action="login!redirect.action">redirect</s:a>类似代码,这是action的动态调用,而struts中默认不允许使用动态调用DMI,所以会报错。在struts.xml中<struts>标签内加上<constant name="struts.enable.DynamicMethodInvocation" value="true"/>即可。
4、检查jsp页面struts标签使用是否规范。当使用了struts标签时,需加入如下代码:<%@ taglib prefix="s" uri="/struts-tags" %>;若没有使用struts标签,则无需加入此行代码。