aspose file tools*
The moose likes Other Open Source Projects and the fly likes Validation examples Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Validation examples" Watch "Validation examples" New topic
Author

Validation examples

Nelo Angelo
Ranch Hand

Joined: Jul 25, 2011
Posts: 44

Hello everyone,

Can anyone please suggest me with some examples of how to validate data on the server side. I tried out the Javascript and looked at some regex methods. The regex methods actually use methods from the class Pattern. I cannot find examples that uses Validator class. I was told to read the Javadocs but I am not able to understand how those methods work.

So I would appreciate if anyone could provide me with links to examples for validation at the server side.


I love java but she hates me... :'(
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

What Validator class? There isn't any Validator class in the Servlets Specification. Are you using a framework? If so, which one?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nelo Angelo
Ranch Hand

Joined: Jul 25, 2011
Posts: 44

Correct, there are none in the Servlets specification.

I was asking about the one in "javax.xml.validation.*" package.

If this package is not discussed in the Servlets section would you please suggest me the methods/examples of Input/Data Validation in servlets.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

The javax.xml.validation.* package is for validating XML files against schema's

If you need to perform regular validation for a web application - you might have to choose from a host of third party validation frameworks available out there.

  • Apache - Validator
  • Spring Validator
  • Hibernate's Bean Validator (JSR-303)


  • Most of them provide plugability into most of the web frameworks.

    There is no standard way to validate data on the server side (as per the servlet specs) but most frameworks provide some sort of validation step (e.g. Struts 2 validation)


    Cheers - Sam.
    Twisters - The new age Java Quiz || My Blog
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Validation examples
     
    Similar Threads
    Server Side validation and client side validation
    Does it happen to you? Website Form can only be sent through your computer but not others?
    Multi File Templates in Eclipse (Code Generation?)
    anybody who know struts' DynaActionForm?
    struts validator