如果动作名称为"apply",则Struts 2动作不起作用. [英] Struts 2 action not working if the action name is "apply"

查看:66
本文介绍了如果动作名称为"apply",则Struts 2动作不起作用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题很简单,如果操作名称是 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 的示例:

Example of the 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 keyword?

推荐答案

否, apply 不是关键字.

该错误消息告诉您,没有为操作定义成功的结果.

The error message tells that no result defined is success for the action.

在大多数情况下,这意味着该操作未配置任何结果.如果您使用约定或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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆