Matt RaibleMatt Raible is a Java Champion and Developer Advocate at Okta. developer.okta.com

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

Better client-side validation with Prototype

I'd love to see something like Really easy field validation with Prototype integrated into Commons Validator and other web frameworks' validation engine. The only hard part would be looping through form elements and adding classes with the validation information. Other than that, it doesn't seem like it'd be too hard to implement. Hat tip to Ajaxian.com.

Posted in Java at May 09 2006, 02:59:29 PM MDT 7 Comments
Comments:

Now that I am using Hibernate Annotations Validator, I stopped using commons validator. You can use the hibernate validator without using hibernate for persistence. I wrote some jsp 2.0 tag files to handle binding my form fields with spring mvc, and I use reflection to check for the validation annotations. This makes it no work to have a js calendar for all Date fields, or have class="required" added to all fields that have a @NotNull annotation. I'd be happy to send you the code for appfuse 2.0.

Posted by Ted Bergeron on May 09, 2006 at 04:03 PM MDT #

Ted - I'd definitely be interested. It might take some work to hook this into SAF 2, JSF and Tapestry, but I'm always up for a challenge.

Posted by Matt Raible on May 09, 2006 at 04:07 PM MDT #

Ted, I'm interested too. Can you post your code/instructions to the appfuse mailing list? Thanks a lot.

Posted by Ivan on May 10, 2006 at 08:36 AM MDT #

I was in the process of doing a write-up about this. I need to strip out my app specific comments, and put it together. I should have it ready next week. Ted

Posted by Ted Bergeron on May 11, 2006 at 11:13 AM MDT #

Ted, did you post the code somewhere? I'm also interested in this kind of stuff. I searched the appfuse mailing lists, but didn't find anything

Posted by Christian Seiler on July 12, 2006 at 05:59 AM MDT #

If learned from the support I built in for Wicket using fValidate:
  • People don't care about it. Really. They ask whether you have javascript validation support so that it makes them feel warm and fuzzy. And then they go on with their lives and just build in validation the old fashioned way.
  • Depending on a cool little javascript library is friggin' dangerous. I've had it with fValidate, jscalendar, and a bunch of other libs I didn't use for Wicket. They were no longer supported by the authors. Guess who gets the bug reports?
  • It's only good for trivial cases. Once you get to slightly more complicated stuff, even with something that is relatively simple in Java, like validating localized dates and numbers, the implementation gets hard to do well, and before you know it you'll have to put a lot of effort into something you thought was just going to be a nice little extra.

Wicket supports ajax validation for quite a long time already. Comes out of the box, and just Java knowledge is enough. E.g.

RequiredTextField fc = new RequiredTextField("email");
fc.add(EmailAddressPatternValidator.getInstance());
fc.add(new AjaxFormValidatingBehavior(form, "onchange"));

I think using ajax for this (and thus validating on the server) is a lot better than client side validation in the sense that it is much easier to build (and thus more robust), integrate with the rest of the system, easier to debug, and there are not really any catches either..

Posted by Eelco Hillenius on July 12, 2006 at 07:54 AM MDT #

[Trackback] Remember when I wrote about Better client-side validation with Prototype back in May? Ted Bergeron responded to my post with the following comment: Now that I am using Hibernate Annotations Validator, I stopped using commons validator. You can ...

Posted by Raible Designs on September 19, 2006 at 07:31 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed