struts2 making me go mad

邮差的信 提交于 2019-12-20 03:17:01

问题


I have been trying to make a java project. Its using Struts 2 tags. There is a button Update whenever it is to be clicked, it should update the values in the database.

But I am getting this error:

No result defined for action com.comviva.im.ui.action.sysadmin.CUGAction and result input


回答1:


No result defined for action com.comviva.im.ui.action.sysadmin.CUGAction and result input

This means that you are lacking the mapping for the input result for this Action in your Struts.xml

The standard workflow

JSP -> Interceptor Stack -> Action

is breaking BEFORE reaching the Action, most likely by the ConversionError Interceptor (eg. sending a String to an Integer, for example), and it is returning back without even reaching the Action.

Read more on Struts2 INPUT result: how does it work? How are conversion / validation errors handled?

When trying to come back, it can't find where to go.

So you must define an input result type:

<action name="CUGAction" class="com.comviva.im.ui.action.sysadmin.CUGAction">
    <result name="success">/your.jsp</result>
    <result name="input">/your.jsp</result>
</action>

Then print out the error in your JSP with <s:fielderror /> and with <s:actionerrors />, and try to figure out what is happening.



来源:https://stackoverflow.com/questions/13379239/struts2-making-me-go-mad

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