Forums Register Login
[Struts 2] execute not called - strange error message
Hey experts.

I'm writing a web service. I have thise action handler hierarchy:

The interesting part of my struts configuration:

When I first call "rateKeywords.action" everything runs as designed and the KeywordRating.jsp shows up.
Whenever I send the form from this jsp back to this action something strange happens:
1. Struts seems to be called correctly
2. the action handler (KWRatingAction) is created (I had a breakpoint in the default constructor)
3. Than something is called - I don't know what - that returns "input" to struts. The execute() Methode of my action handler (KWRatingAction) is NOT called.

The strange thing is, that the return value "input" is only used on two places in my webapp. I had put breakpoints to this places, and they where NOT passed during the round trip.

The Question is: From where comes this return value INPUT??

4. You can see from the code above that no result for "input" is specified so finally the following error occures:

[ June 26, 2008: Message edited by: K Fleischer ]
[ June 26, 2008: Message edited by: K Fleischer ]
To give you some more information:

If I change the language by doing this:

This will return an 404 error (because of the problem I descriped). But when I than press F5 and reload the website, the new language is used.
So the language is changed in Struts. The problem of the "injected input" must arise in a later stage.
[ June 26, 2008: Message edited by: K Fleischer ]
Just for a test i've add a result so the struts.xml looks like this:

(It must be "input" and not "INPUT")
Now, the site shows up again, but without all propertys. It seems (and this would fit to the things I already had written) that the action handler class was not executed and the properties are not set in the handler.

So somehow the request is "hijacked" by some other handler. I don't understand this right now.

If you have an idea, please write. If you need more information please tell me.
I've got it!!!

And it's a bit strange.

The fault was - of course - on my side. BUT the reaction of struts was not propper.

I had those two properties declared in my action handler:

But - thanks to a copy paste error - in the JSP there where both fields set to "false". So the the conversion to at least int was the reason for this "hijacking".

What is strange is, that struts had not reported me a conversion error. This had cost me a dozend of hours of my lifetime.

But now I'm happy! It works!
I know this is a very old topic, but I came across something similar today that I thought I'd share.

Same exact symptons as the guy above; get punted out of the action class after the constructor but before the execute() method. Tracked it down to an action error I added via ActionSupport.addActionError() during SessionAware.setSession().

Turns out if there are any action errors present, then your execute() function gets preempted, changing the addActionError() to addActionMessage() fixed it. I'm sure the exact location of "return(INPUT)" could be found by searching the source code of the interceptor classes in the default interceptor stack, but no time for that now...
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards

This thread has been viewed 3657 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jan 17, 2018 04:24:13.