I can't seem to get Struts 2 validations to work. I have been converting from Strust 1 to Struts 2. So far I've refactored all the code (for this particular module) on the back end, rewrote the jsp using Struts 2 notations, and wired up the xml (aside from the abc-validation.xml). Everything runs just fine. If there is an error not generated by user input (i.e. file format problem) I can get that message to come out, so I know my error messages work. I try to add the abc-validation.xml for my abc class, but the validations never catch. The input field types I'm using are of select (x3) and file(x1). The selects all use numbers (default 0), and the file is just a file path (default blank). I set my validation.xml (below) to have a min of 1 for the selects, and required for the file field. So when I hit submit I expect something to come back with out hitting my action class, but it doesn't. My action does extend ActionSupport and implements RequestAware. Can anyone point me in the right direction?
First off, and (probably) not related, is that your per-action interceptor configuration is way off... you're defining a *whole* bunch of interceptors twice (or more, in several cases). As shown you've got the entire "paramsPrepareParamsStack" *plus* the "defaultStack" *plus* and additional "validation" interceptor. This is almost certainly not what you want.
Secondly, for the default validation process to work you must have a result named "input"--that's the result a failed validation will return by default. Your "error" result is probably what you'd want to be "input" instead.
The .monitor.Monitor tile (the "input" result) has the form using non-simple-theme input tags and/or the field error msg tag? In the previous version it looked like all that was in the .user.LoadFile tile.
I'd have to write a quick sanity check beyond that, which I can't do at the moment--maybe later in the day though.
Sorry about that confusion .user.LoadFile is just a mask. There are some paths that contain the name of my company so for my own job security (especially in todays market) I decided to change all the names. Anyhow it is just a tile reference that maps the input jsp.