2

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

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
JammuPapa
  • 138
  • 1
  • 1
  • 10

1 Answers1

4

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.

Community
  • 1
  • 1
Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
  • Just a note: from result configuration `Likewise if the name attribute is not specified, the framework will give it the name "success".` http://struts.apache.org/2.x/docs/result-configuration.html – Aleksandr M Nov 14 '12 at 13:46
  • I would not call that a bad practice, "Intelligent Defaults" instead. :) – Aleksandr M Nov 14 '12 at 14:21