Struts 2 action not working if the action name=“apply”

一世执手 提交于 2019-12-25 07:51:38

问题


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:


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.



来源:https://stackoverflow.com/questions/18819159/struts-2-action-not-working-if-the-action-name-apply

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!