I do all my validations in the action, and it works great for me. I built a layer upon the action that allows me to activate / deactivate validation for some actions. So i turned my actions into page controllers.
I suppose some people would argue that this "resists" the framework, but i think that i'm so comfortable working like that !! bye On Sat, 19 Mar 2005 02:01:28 +0000, David Kennedy <[EMAIL PROTECTED]> wrote: > Sorry, this is going to be a fairly off-topic reaction post, but > Lawrie's comments struck a chord with me. > > Lawrie Gallardo wrote: > > I'm relatively new to Struts and I have to say that I've found it to > > have a realtively steep learning curve. And the only reason for this is > > that there are so many different ways to do things and no definitive > > best ways of achieving anything. > > I totally agree. I have just transitioned to the web tier from a career > slaving away at the back-end of large Java server systems for telecomms > and finance. I was looking forward to using Struts quite a bit, > suspecting, perhaps wrongly, that the nature of web tier work would mean > a fast evolution of high-quality tools. Maybe I've been spoilt by a life > dominated by strict (read: paranoid) coding practices, Ant and JUnit, > but Struts is rather a confusing mess once past the initial "Oh, cool, a > working action and page!" phase. And this is coming from someone who has > just fled EJB land... > > For example, I've got a couple of Really Common Requirements - logon and > a side nav bar / tree view. I've been amazed that I've not found a > simple, standard example for either of these. Instead, I've tripped over > a wealth of little fiddly details that derailed my progress. Nothing > like lots of soft XML config to really trip you up with details I > find... "I've never even heard of that option, and when I tried to use > it I wasted 5 hours not noticing a typo in one of the repeated strings!" > > > I'd much rather there was a bit > > of focus to the framework than the mass of competing options. "Make the > > simple things simple and the hard things possible" and all that... > > Totally agree. For example, I did some work with Struts Layout:Treeview > for my nav bar prototype. I very much appreciate volunteer effort, and > don't wish to knock anyone's efforts, but I have to say that for a > standard solution advocated by a couple of books it's fairly poor... > There were a couple of immediate show-stoppers with working with the > Treeview which was very disappointing. (Turns out the license precludes > commercial use anyway.) The point of this isn't to knock Layout (again, > I appreciate effort and feel guilty that I don't pay back into the > commnunity that makes me fine tools), but rather to illustrate how > something fairly standard - a treeview nav bar with a load of > actions/forwards - is surprisingly difficult for a beginner with the > toolkit to knock up cleanly. > > I guess some of this cognitive whiplash comes from the fact that several > of the core components are Very Cool. The core idea of the actions is > just Very Sensible, the basic idea of using ResourceBundle keys > everywhere Just Works, etc. I particularly like Validator, although I > can see, as this thread is discussing, room for disagreement about > alternative implementations. Custom rules are very nice, and very easily > added. I'm just troubled by the fact that most of the elements I find > straightforward and cleanly finished are those which my boss just > doesn't see! The basic project elements he wants in a couple of days - > that tree view in a readable/maintainable form, a nice simple PAM login > & timeout mechanism* - turn into real timesinks. (Actually, to be fair, > the move from 1.0 -> 1.1 and similar shifts in several libaries also led > to confusion when working from Googled, and often conflicting, advice.) > > This is a rather rude rant I know, and I appreciate people are > scratching their own itches, but it would be nice to seem some concerted > effort to solve some of the FAQs cleanly, and to generate more of a core > catalogue of Patterns for noobs like myself. (Kudos to people like Ted > Husted who do maintain some useful resources.) In that vein, I'm very > much looking forwards to the new Struts Cookbook that O'Reilly have just > put out, was rather hoping to see it in the post this morning. Might > well answer lots of questions for me. > > I'm not sure I should hit 'Send' on this for fear of offending people, > please just see this as constructive initial impression feedback. I see > a lot of promise in the Struts toolkit, better be, sort of bet the > project on it now!, and would love to see more consensus emerging about > Best Practices. > -- > David Kennedy > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]