一个通配符匹配action的问题

J2EE 码拜 7年前 (2017-04-21) 853次浏览
在JSP里有这样一行代码

<a href="${ pageContext.request.contextPath }/user_registPage.action">注册</a>|

然后是applicationContext中的代码

<!-- 用户模块Action -->
	<bean id="userAction" class="com.shop.user.action.UserAction" scope="prototype"></bean>

最后是struts中的代码

<!-- 用户模块 -->
	<action name="uesr_*" class="userAction" method="{1}">
	<result name="registPage">/WEB-INF/jsp/regist.jsp </result>
	</action>

但是这样的话  一直报错 死活找不到action
There is no Action mapped for namespace [/] and action name [userregistPage] associated with context path [/shop].
但是假如改成下面这样

<action name="*_*" class="userAction" method="{2}">
	<result name="registPage">/WEB-INF/jsp/regist.jsp </result>
	</action>

这样就能找到了  ,跳转到了界面
这到底是什么原因呢
还请指点

解决方案

40

uesr_ 单词写错了…

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明一个通配符匹配action的问题
喜欢 (0)
[1034331897@qq.com]
分享 (0)