严重: Could not find action or result
There is no Action mapped for namespace / and action name login. - [unknown location]
解决方法:
可能的原因:
1.-----首先查看你的struts.xml 文件是否在src目录下;
2.-----检查struts.xml文件的语法是否正确: 如果1正确的话那就一定是struts.xml文件的问题: <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="struts2" extends="struts-default">
<action name="login" class="com.test.action.LoginAction">
<result name="success">/result.jsp</result>
</action>
</package>
</struts>
那么就只有是红字的部分写错了 查看你的是否吧struts-default中间的“-”错写成了struts=default;
二.确定名称是 struts.xml
三.粗心,仔细检查配置文件,和excute方法的代码