• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

jsf and validation

 
Ranch Hand
Posts: 8946
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does JSF have components to validate user entered values?
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, in fact jsf life cycle has an entire phase for performing the validation.
Check out this link
[ December 14, 2004: Message edited by: K Varun ]
 
Pradeep bhatt
Ranch Hand
Posts: 8946
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Varun,

You are an JSF expert.

What implementation and tools are using for developing JSF?
 
Pradeep bhatt
Ranch Hand
Posts: 8946
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a chapter on validation
http://www.cs.sjsu.edu/faculty/horstman/corejsf/geary-horstmann-corejsf-chapter6.pdf
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Validation is a heck of a lot simpler with JSF than with Struts. However, Sun's RI doesn't provide any client side validation. So everything goes to the server. Other vendor implementation may provide validators for client side validation.

You can validate simply using the faces taglib like:



You can also call a method in your backing bean to do the validation:



For the standard validators that's all there is to it. You don't have to maintain any other files (like struts validator XML file(s)).
[ December 15, 2004: Message edited by: Gregg Bolinger ]
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pradeep Bhat:


What implementation and tools are using for developing JSF?



WSAD 5.1.2 & RI 1.1
 
author
Posts: 284
35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Core JSF has a section on using the JavaScript in Struts Validator for client-side validation. That way, you don't have to write and debug your own JavaScript.

Cheers,

Cay
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Cay Horstmann:
Core JSF has a section on using the JavaScript in Struts Validator for client-side validation. That way, you don't have to write and debug your own JavaScript.

Cheers,

Cay



Hey Cay,
Welcome to Javaranch !!!

Will you advocate doing client side validations in JSF? Can you please quote some example/scenarios for the same and the advantage it will provide over the server side validations.

Thanks,
 
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic