Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsf and validation

 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does JSF have components to validate user entered values?
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • 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: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • 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: 8927
Firefox Browser Java Spring
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Cay Horstmann
author
Ranch Hand
Posts: 172
15
  • Mark post as helpful
  • send pies
  • 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
  • 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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic