The goal: To validate that two email addresses match each other (or passwords, or whatever). What I've been toying with is creating a custom validator that takes a parameter, and compares it to the JSF object.toString() that it was bound to... thus comparing two strings.
A coworker suggested that I map the objects using the facesContext to the backing bean for the JSP, and then access the values in the validator. However, I thought it cleaner if I just wrote a custom validator that compared two strings... without binding and such.
My questions are:
1. can you write a custom validator that takes a parameter/ attribute?
2. I've got one coded up, but the JSP that implements it says the body must be empty for f:validator
Thanks in advance for any advice, suggestions, and pointers!
[ March 29, 2005: Message edited by: Michael Sullivan ]
A coworker suggested that I map the objects using the facesContext to the backing bean for the JSP, and then access the values in the validator. However, I thought it cleaner if I just wrote a custom validator that compared two strings... without binding and such.
My questions are:
1. can you write a custom validator that takes a parameter/ attribute?
2. I've got one coded up, but the JSP that implements it says the body must be empty for f:validator
Thanks in advance for any advice, suggestions, and pointers!
[ March 29, 2005: Message edited by: Michael Sullivan ]