Struts 2 action not working if the action name=“ap

2019-09-19 08:23发布

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

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>

So is apply a kind of Struts2 key word?

1条回答
Ridiculous、
2楼-- · 2019-09-19 08:50

No, apply isn't a keyword.

None of these configurations apply to the action being executed.

The error message tells that no result is created for the action but there's a result code and result code is not "none".

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.

Use the config-browser plugin to see the configuration provided to your application or debug to troubleshoot it.

查看更多
登录 后发表回答