如果操作名称为"apply",则Struts 2操作不起作用. [英] Struts 2 action not working if the action name="apply"
问题描述
问题很简单,如果操作名称是应用" 该操作根本不起作用,它使
Problem so simple, if the action name is "apply" this action doesn't work at all, and it gave the
HTTP Status 404 - No result defined for action com.control.actions.ClassName and result success
struts.xml
的示例:
<action name="apply" method="display"
class="com.control.actions.ClassName">
<result name="none">/page.jsp</result>
</action>
,但如果动作名称为其他名称,则可以使用 像:
but it works if the action name is anything else like:
<action name="applying" method="display"
class="com.control.actions.ClassName">
<result name="none">/page.jsp</result>
</action>
应用是Struts2的一种关键词吗?
So is apply a kind of Struts2 key word?
推荐答案
否, apply 不是关键字.
这些配置均不能应用至正在执行的动作.
None of these configurations apply to the action being executed.
错误消息表明没有为操作创建结果,但是有一个结果代码,而结果代码不是"none"
.
The error message tells that no result is created for the action but there's a result code and result code is not "none"
.
在大多数情况下,这意味着该操作未配置任何结果.如果您使用约定或rest插件,则可能存在使用约定创建的隐式配置.
In most cases this means that no result is configured for the action. If you are using convention or rest plugins there may be implicit configs created using conventions.
使用 config-browser 插件查看配置提供给您的应用程序或调试以对其进行故障排除.
Use the config-browser plugin to see the configuration provided to your application or debug to troubleshoot it.
这篇关于如果操作名称为"apply",则Struts 2操作不起作用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!