struts2的Action名字的大小写问题

今天在使用struts框架编写Action类以及在jsp中写调用相关Action的url时出现如下错误:

There is no Action mapped for namespace [/]  and action name [MainPage] associated with context path [/xxx]. - [unknown location]


记得以前也曾经遇到过这样的错误,可能的原因有:

1,struts.xml文件中配置package时,namespace写错;

2,调用此Action的url写错(app名称多写、namespace写错等);

3,jsp页面基准url没有写;

4,struts.xml的放置路径错误;

5,struts.xml文件的DTD声明写错;

6,web.xml中首页没有写;

但是,这次调试了好几个钟头都不是以上的错误,

而是因为Action类命名错误,开始是MainPageAction.java,后来改成Mainpage.java,调试通过惊讶

列入错误原因:

7,Action类命名错误:不能在诸如XXXXXAction的名字XXXX中包含大小写混合。

猜你喜欢

转载自fall10.iteye.com/blog/2277435