Matt Raible blogged today about why Struts 2 sucks. At the same time he concluded that Stripes sucks as well. Why? Because neither framework handle invalid property binding feedback properly. Well, let's discuss what might be proper and let's talk about Stripes because I love Stripes. I want Stripes to be the best it can be and we can find ways to improve it, let's do that.
Stripes doesn't use OGNL. When Tim designed Stripes he used OGNL in the beginning and later found out that he could write something a bit smaller and faster that was specific for Stripes and remove another dependency from the project. I think that is great. One less JAR I need to fetch.
One of the many nice things about Stripes (specifically over Struts) is the ability to create pages without wiring up the actions on the back end. with Struts (this could be different in Struts 2, someone please correct me) you had to have your form beans, validation, XML all correct and complete before you could even view your JSP. With Stripes, if a binding resource is missing it's ignored. Is this a flaw? I don't believe so.
When you submit the form or when the page requires binding, which typically isn't on view, Stripes will tell you what you've missed. It's in the debug log, not on screen. So if you had a form that required a first name and a last name. In your action bean you have two strings, firstName and lastName. On the JSP you fat finger lastName to lkastName, the form will display just fine. This is what I would want. I want to see my form. When I submit the form, this is what I get in the debug:
DEBUG Could not bind property with name [lkastName] to bean of type: FormTestActionBean : Bean class com.app.web.action.FormTestActionBean does not contain a property called 'lkastName'. As a result the following expression could not be evaluated: lkastName
And now I know what I need to fix. I'm not 100% sure that Matt views this as a flaw or if maybe he doesn't understand that Stripes does this. From his post I am led to believe that Matt wants immediate feedback if there are binding issues, even prior to submitting the form. I don't agree that this should be an issue. What do you think?
Showing posts with label web applications. Show all posts
Showing posts with label web applications. Show all posts
Wednesday, September 05, 2007
Invalid Property Binding Feedback
Posted by
Gregg Bolinger
at
1:04 PM
5
comments
Labels: java stripes, web applications
Subscribe to:
Comments (Atom)
