There is no Action mapped for namespace [/] and action name [Login] associated wi

There is no Action mapped for namespace [/] and action name [Login] associated wi


当你对于这个比较困惑的时候给你几个建议首先检查你的代码和配置文件

这里以我为例,

我做的是一个简单的登陆页面,

三个jsp, 一个LoginAction.java  一个structs.xml 和一个web.xml文件


这是我的报错截图:


There is no Action mapped for namespace [/] and action name [Login] associated wi_第1张图片





如果有看的眼熟的,那么很好,接着看我的几个文件的截图:


LoginAction.java


There is no Action mapped for namespace [/] and action name [Login] associated wi_第2张图片\



接着是login.jsp



There is no Action mapped for namespace [/] and action name [Login] associated wi_第3张图片




接着是:


web.xml

There is no Action mapped for namespace [/] and action name [Login] associated wi_第4张图片




最后一个structs.xml


There is no Action mapped for namespace [/] and action name [Login] associated wi_第5张图片



不知道你对于报错的信息留意没有,意思是: action的名字是 LoginAction,  最开始写的时候我以为和servlet的一样从jsp的页面表单提交上来的是servlet,其实不是的,应该把提交上来的修改为struct配置的。

应该为和jsp和struct的一致。那么这里我修改了,如图:


There is no Action mapped for namespace [/] and action name [Login] associated wi_第6张图片




这样就可以了。

你可能感兴趣的:(There is no Action mapped for namespace [/] and action name [Login] associated wi)