问题描述
我正在尝试运行我的 struts 应用程序,但我收到错误操作未映射我已经看到命名空间是正确的,但仍然收到错误?
I am trying to run my struts application but I am getting a error action is not mapped I have seen the namespace it is correct but still getting the error?
struts.xml
:
还有我的register.xml
:
我正在验证我的注册页面和验证 XML,如下所示
I am validating my register page and the validation XML as follows
RegisterAction-validation.xml:
而我的register.jsp
如下:
我的项目结构如下:
我收到如下错误?
推荐答案
这个配置错误
使用
redirectAction
结果应该用于重定向到用于定位的动作.
The redirectAction
result should be used to redirect to the action, which name is used for location.
异常来自您尝试提交时的 s:form
标记.Register
动作实际上封装在命名空间 /
中.这不是默认命名空间,因此应该在 s:form 标签上使用.
The exception comes from the s:form
tag when you tried to submit it. The action Register
actually packaged in namespace /
. This not a default namespace and therefore should be used on the s:form tag.
这篇关于关于 Struts2 中的动作映射 - 没有动作映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!