报错 There is no Action mapped for namespace / and action name .

J2EE 码拜 9年前 (2015-04-12) 1020次浏览 0个评论

jsp页面并未请求action,为什么会报这个错误?
给出以下三个资料:
1、JSP页面

<body>

<s:set name="age" value="29"/>
<s:if test="#age>60">
老年人
</s:if>
<s:elseif test="#age>35">
中年人
</s:elseif>
<s:elseif test="#age>15">
青年人
</s:elseif>
<s:else>
少年
</s:else>

</body>

2、struts.xml

<struts>
	<constant name="struts.custom.i18n.resources" value="mess"/>
	<constant name="struts.i18n.encoding" value="GBK"/>

	<!--这一段加上就不报错,注释掉就报错
        <package name="lee" extends="struts-default">
		<action name="">
			<result>.</result>
		</action>
	</package>
        -->
</struts>

3、web.xml
        

<filter>
		<filter-name>struts2</filter-name>
		<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
	</filter>

	<filter-mapping>
		<filter-name>struts2</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

请问红色段落有什么用?初学者,书上也没有解释。。。。

报错  There is no Action mapped for namespace / and action name .
24分
你的那段注释是不是注释错了;
action都加到里面去了;
报错  There is no Action mapped for namespace / and action name .
注释是为了各位好看。就是那段,有的话,就能运行,没有就不能运行。可是,不理解这个action的作用,没有name和class,也没有result。到底它是干什么用的?jsp页面也没有请求这个action呀。

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明报错 There is no Action mapped for namespace / and action name .
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!