Struts 2 Validation

Struts 2 is a very powerful open source web application framework. It was originally created by
Craig McClanahan and donated to the Apache Foundation in May 2000. It is also called Jakarta Struts.

It has several features, following are the features of the Struts 2

  • Simple POJO based Actions
  • Simplified testability
  • Thread Safe
  • AJAX Support
  • jQuery Plugin
  • Dojo Plugin (deprecated)
  • AJAX Client Side Validation
  • Template Support
  • Support for different result types
  • Easy to extend with Plugins
  • REST Plugin (REST based Actions, Extension-less URLs)
  • Convention Plugin (Action Configuration via Conventions and Annotations)
  • Spring Plugin (Dependency Injection)
  • Hibernate Plugin
  • support in Design
  • JFreechart Plugin (Charts)
  • jQuery Plugin (AJAX Support, UI Widgets, Dynamic Table, Charts)
  • Rome Plugin (RSS Feeds)

The feature of Struts2 that attracts me the most is the validation part of the struts 2 . If you do not use the struts 2 validation for the form validation purpose you have to use the  JavaScript  , but using JavaScript is a very lengthy and complex process and you have to write a large code to validate a single field. so if you are working with struts2 , it is a best option to use struts validation in place of  JavaScript or AJAX because struts2 do it easy for you.


Note: the validation file name should be carefully written
Format for name is

example NewTeacher-validation.xml file should be kept in the folder where your action file is located
—NewTeacher-validation.xml—(validation file)


Leave a Reply

Contact Us
close slider
Contact Us

How can we help you with?