Hi All,
I have a application in struts framework which requires username password for login.If NewUser then I have a registration form to be filled by the user to register. The problem is that I am unable to stop duplicate values in the username field.I can do tat by making username as primary key in database but tat will not provide error information to user except providing error at server side.Can anybody tell me t way to do this.
Thank u All
ankit

01-04-2008, 10:19 PM

gibsonrocker800

well i dont know anything about JSP, but i know that in regular programming, to prevent added a duplicate object to a certain list, you can use a HashSet.

You can use Ajax if you like to show error or avialiblity of username in real time..

01-05-2008, 08:50 AM

PortalTeam

I feel that u could try validating the user name with the database itself.
Once when the user finishes the registration u can have the user name in the form bean and then inside the action classe's execute method u could do the validation of this new user name with that existing in database.(using the select count query).If the name already exist's the u redirect the user to the registration page with the msg notifying him that the name already exists.
I think this will do .All the best