Struts2中关于"There is no Action mapped for namespace / and action name"的总结

   今天在调试一个基础的Struts2框架小程序。总是提示"There is no Action mapped for namespace / and action name"的错误。上网查询后发现这是一个初学者经常碰到的问题,导致错误的原因主要有三种。总结如下:

   一、struts.xml文件错误。这种错误又分为以下几种:1,struts.xml文件名错误。一定要注意拼写问题;2,struts.xml文件放置路径错误。一定要将此文件放置在src目录***意红色部分;

Struts2中关于"There is no Action mapped for namespace / and action name"的总结


编译成功后,要确认是否编译到classes目录中,注意时间是否为当前编译时间.

Struts2中关于"There is no Action mapped for namespace / and action name"的总结

 三、如果排除了struts.xml文件的问题,还有一种可能就是,在web.xml文件中的<welcome-file>信息中是否配置了自己工程的启动页面。如果没有配置,地址栏中要输入完成的url;

Struts2中关于"There is no Action mapped for namespace / and action name"的总结



如果以上问题都不是,那肯定是你忘启动服务器了....