• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 2 MPU wrapper on WAS 6.1 short-circuiting stack?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having an issue with the Struts 2 (2.0.4) MPU wrapper on WAS 6.1. This is in an application that works fine on Tomcat, where the following happens:

* if a valid file is selected, my action moves it to a folder and returns SUCCESS, and the view component displays it as expected.
* if the file violates the size limit in struts.properties, the MPU wrapper rejects it, returns INPUT, and my browse form redisplays
* if my action rejects the file (for any reason), it sets a fielderror and returns INPUT, and my browse form redisplayes with the message

On WAS 6.1, here's what happens. I lknow the details because I have a timer plugin (ala Brown's book) that I'm using to separately wrap both the entire request and the action:

* for a valid file, I see the same behavior as on Tomcat (file displayed by view). I can see the timer's messages entering execute(), invoking the action, and capturing the result (SUCCESS).
* for a file rejected by the MPU wrapper, I see the timer's messages at the request level (capturing a result of INPUT), and the second timer interceptor wrapping the action is never invoked (as expected).

Now it gets strange...

* for a file my action would reject, I see the timer's request and action entry mesages, and I can see that the action was invoked. However - thet's the last thing I see in the log - no capture of a result by the timer wrapping the action, or the request on the way out.

The other stragnge thing is that I also don't see the diagnostic messages the action should be emmitting to system.out.

It's pretty clear that the action set a fielderror and returned INPUT (since this is what it does for these test files on Tomcat), but it is as if the MPU wrapper has short-circuited the rest of the stack.

The end result is that my view component gets fired (as if SUCCESS!), can't find the expected file, and throws an exception (and for some reason, my global results and exception mappings aren't working in this case either).

Has anyone else seen this behavior, or successfuly rejected files from anupload-related action?
 
Jeff Hill
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops! pilot error.

I was porting a Struts 1 app, and when I converted the Action class, I inexplicably - though it was probably verrry late - coded the "execute()" method as having an ActionContext argument. Hence, no match with the default execute() in ActionSupport, which of course simply returns SUCCESS.

The nice thing about Struts 2 Actions is that they're just POJOs with an execute() method. But that also means the compiler won't tell you when you've screwed up. In fact I'm surprised this hadn't happened before, since I've been working with S2 since January!
[ September 04, 2008: Message edited by: Jeff Hill ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic