Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
sangeeth k
email validation already taken
August 28, 2012 7:46 AM
Answer

sangeeth k

Rank: Regular Member

Posts: 114

Join Date: April 22, 2012

Recent Posts

Hi team,

I am working in liferay 6.1 CE

I created custom registration portlet there user is created successfully using adduser method.

I have one problem email Id issue,

I have to check validation for email id

If i enter already taken email id there i have to give validation(like in liferay default registration) given emailid is id already taken.

any suggestions..



thanks
Shinn Lok
RE: email validation already taken
August 28, 2012 8:27 AM
Answer

Shinn Lok

LIFERAY STAFF

Rank: Junior Member

Posts: 89

Join Date: January 14, 2011

Recent Posts

We have this check in UserLocalServiceImpl#ValidateEmail
1if (!emailAddress1.equalsIgnoreCase(user.getEmailAddress())) {
2    if (userPersistence.fetchByC_EA(
3            user.getCompanyId(), emailAddress1) != null) {
4
5        throw new DuplicateUserEmailAddressException();
6    }
7}
sangeeth k
RE: email validation already taken
August 31, 2012 5:24 AM
Answer

sangeeth k

Rank: Regular Member

Posts: 114

Join Date: April 22, 2012

Recent Posts

Thanks for reply Shinn Lok emoticon

but another thing...

I did like this
1if(e instanceof DuplicateUserEmailAddressException) {
2                        throw new DuplicateUserEmailAddressException();
3                    }
4[b]in jsp page:[/b]
5<liferay-ui:error exception="<%= DuplicateUserEmailAddressException.class %>" message="the-email-address-you-requested-is-already-taken" />


The above code is working for at the time of submit the form But I need to check @ field entering time itself.

any suggestions..................