Tag Archives: Web Development

Spring MVC Bean Validation with Annotations

Input data validation is a critical piece of functionality in any web application because we cannot always rely on users to enter valid data. We need to safeguard our data-stores and business processes against both malformed as well as malicious data.

Based on my experience with Spring, I thought of writing a series of tutorials on different methods of validating form input when working with Spring MVC.

This is the first part of that series, and I will be focusing on basic form data (i.e. data submitted by the user) validation in Spring MVC 3 using declarative annotations. In the future, I am hoping to touch on more advanced topics such as:

  1. Displaying custom messages for validation errors
  2. Writing custom annotations to validate view models (or fields)
  3. Using JSR 303 groups to perform conditional validations
  4. Validation using Spring’s Validator interface
  5. Comparison of different validation methods in Spring MVC (pros, cons and when to use them)

Hopefully by the end of the series, you will have a good idea about Spring validation mechanisms, and be able to pick the best option(s) for a particular problem.

Continue on to learn how to perform basic annotation-based validations in your Spring MVC 3.x web applications.

Continue reading

How to setup Zend Framework with Apache on Windows

Zend Web Framework is one of the most popular PHP frameworks out there to ease the construction of web sites. Though, there are lots of online tutorials on how to set it up using Apache, details are bit sketchy on getting everything to work on Windows machines. I was following several online tutorials, including the official tutorial from the Zend website itself, but kept running into various problems associated with getting Apache and Zend to work properly.

I am sure I am not alone with these issues, and compiled a small guide to show how to get Zend framework working on your windows machine (tested on XP, Vista and Windows 7) using Apache web server.
Continue reading