• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

"Struts 2 Design and Programming: A Tutorial" Validation Question

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Budi,

From everything I have read, the validation framework for Struts 2 is considerably different from that of Struts 1. The configuration and syntax looks to be much friendlier. Would you consider it to be a total improvement, or are there areas that could still use improving?

Also, how tough is it to write a custom validator within the new framework? Thanks!

- Schevus
 
Author
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Schevus,

Struts 2 validation is based on the XWork Validation Framework and is as easy to configure as that in Struts 1. I think the validation features are comparable.

Writing a custom validator in Struts 2 is not hard. You just implement the Validator interface that is part of the com.opensymphony.xwork2.validator package or extend a convenience base class. Chapter 7 of my book explains how to write custom validators in detail. There are standard validators that are sufficient in most cases, though.
 
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic