日期:2014-05-17  浏览次数:20683 次

在原来ssh框架搭建的项目基础上新建struts的action启动后却提示找不到action的映射名称??
各文件的相应代码:

helpRight.ftl文件:
<div class="title"><a href="/noticeAndTopicList.do">更多>></a>公告</div>

struts-web.xml文件:

<package name="web" extends="struts-tourhb" namespace="/">
  <action name="noticeAndTopicList" class="web.EmptyAction">
  <result name="success" type="freemarker">/WEB-INF/template${theme}/web/noticeAndTopicList.ftl</result>
  </action>
</package>

spring-action.xml文件:

<bean id="web.EmptyAction" class="com.tourhb.action.web.EmptyAction" singleton="false"/>

这个bean标签本来就存在的,而且可以被调用成功,但是为什么新建了一个action以后再调用这个bean就报错了?

错误如下:

There is no Action mapped for namespace / and action name noticeAndTopicList. - [unknown location]

------解决方案--------------------
是不是那个helpRight.ftl里的href那儿多了个“/” ,改成
<div class="title"><a href="noticeAndTopicList.do">更多>></a>公告</div>看看
------解决方案--------------------
清下tomcat的缓存,重部署试试