Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

[Struts 2] execute not called - strange error message

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
K Fleischer
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
K Fleischer
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
K Fleischer
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic