Microsoft
Software
Hardware
Network
Question : JSF/Hibernate: Custom Validators
Using JSF/Hibernate in a java web application. I want to use custom JSF validation. One of the validator will be used to cheque for uniqueness in the database so that for example i will not have more than one email address in the table.
This easy enough but i want now to have a generic validator so that i can call it regardless of the table or field for which i want to validate for uniqueness. How can i achieve this considering the validate function only accepts only 3 values i.e. FacesContext, UIComponent and the Object value? I want to fore xample be able to pass the object name of the object i want to search for in the database, the field name for which i want to check uniqueness and the value entered.
Answer : JSF/Hibernate: Custom Validators
As an example, you can store the extra info you need in UIComponent's attributes or as a session or request attribute, i.e. FacesContext.getCurrentIns
tance().ge
tExternalC
ontext().g
etSessionM
ap().put("
yourAttrib
ute", yourData);
Random Solutions
How to fix windows xp service pack 3 install error: "The system cannot find the file specified"
Displaying GroupWise contacts in Exchange address book?
FTP not working on Windows Server 2008 IIS 7
Need a random list of 1000 geocoded locations in any one country
Variable not defined error using VBA ExportAsFixedFormat Type:=xlTypePDF in excel 2003
SQL 2005 Select Query from multiple tables
Should Sys Admins (Domain Admins) also have user accounts?
PL/SQL Export table data to .csv file and save; launch Excel inside PL/SQL and load saved .csv file
PHP 5.3.2 installation problem on Vista IIS7
Rundll error error loading F3SCRCTR.DLL