Validating email address - please help?

hi,
i have registration form in jsf, and i have a field for an email address, i was wandering if anyone knows how to validate the email address, when this is submitted to a javabean, to make sure it is an actual valid email address and that both email addresses ( re-entered ) entered are the same.
so what i really want is the javacode for the javabean that can validate the email address to make sure it is valid.
any help is appreciated
thanks.

Here's how I did a Postal code validation:
public void validatePostalCode(FacesContext context, UIComponent toValidate, java.lang.Object inputValue) throws
ValidatorException {
Pattern pattern;
String expression = "\\D{1}\\d{1}\\D{1}\\d{1}\\D{1}\\d{1}"; // x9x9x9
String value = null;
try {
value = inputValue.toString();
pattern = Pattern.compile(expression);
this.postalCodeValidationError = !pattern.matcher(value).matches();
} catch (ClassCastException e) {
throw new ValidatorException(
new FacesMessage(
"Validation Error: Value " +
"cannot be converted to String.",
null));
if (this.postalCodeValidationError) {
// Here you do what ever you want when the validation fails
// Like generating an error in JSF ... see ValidatorException
On your JSP page add "validator="#{yourBean.validatePostalCode}"" to your inputText tag.
It would be a good idea to read on Java's regular expression stuff to fihure out the expression you need to pass to Pattern.compile(expression) in order to validate the email address.
Hope this help. Cheers

Similar Messages

  • Apple asking me security questions that ive never set up and i can't purchase anything, and ive tried resetting them but i can't remember the password for my rescue email address, please help?

    Apple asking me security questions that ive never set up and i can't purchase anything, and ive tried resetting them but i can't remember the password for my rescue email address, please help?

    You need to either reset the rescue email address's password(check the site's help for instructions) or ask Apple to reset your security questions; ways of contacting them include clicking here and picking a method for your country, phoning AppleCare and asking for the Account Security team, and filling out and submitting this form.
    (99674)

  • Won't let me change my Apple ID email address please help

    Won't let me change my Apple ID email address please help I have signed out of iCloud and iTunes. I really need to change the email address as the 1 that is currently

    What happens when you try to change the email address ? You should be able to edit your primary email address (as long as it's not an @icloud.com, @me.com or @mac.com address) by logging into the account via the Store > View Account menu option on your computer's iTunes or by logging into on http://appleid.apple.com
    Changing primary email address : Change your Apple ID.

  • Skype stolen email address please help.

    Few days ago I returned from my holiday. Someone must have had access to my Mac and changed Skype email address and my password.
    My Skype username remains the same and the password is shown decrypted below my username. I can still log-in and use Skype as usual.
    - Is there any change to retrieve the Skype password?
    - Is it maybe saved somewhere on the hard disc so I can access data and change Email and PW?
    Thank you for your help - much appreciated!!!!

    patagonia123 there is no reason for you to get rude to someone who is trying to be helpful. Whether you realize it or not this is forum venue is for Apple hardware abd software. That said shldr2the wheel was directing you to where you can get help. From what you've said how do you know someone had access to your Mac and changed the info you describe? If that was so you wouldn't be able to log into skype. Try the skype forums.

  • HT5312 forgot my rescue email address please help

    how to recover my rescue email address

    If you can correctly answer at least two of the security questions, follow the instructions in that article. If not, you need to contact Apple, either through the link in it or by phoning them and asking for the Account Security team.
    (80350)

  • Please help! Valid email address?

    Why do I keep getting asked to enter a valid email address? I have verified my email but yet I can not continue with adobe unless I enter my email WHICH I HAVE!

    This is a User 2 User site. We do not have control over how the site functions. But all users must signin to the forums to post. When you sign in review the options and select options that might adjust you login, like "remember me" or "stayed logged in".

  • I restored my ipod touch however the apps will not sync.  I tried to re-download but I changed my apple id as my old id is no longer a valid email address.  Any ideas out there please

    I restored my ipod touch however the apps will not sync.  I tried to re-download but I changed my apple id as my old id is no longer a valid email address.  Any ideas out there please?

    It might be logical to someone, but not to me. I agree it's a pain.
    How did you change your Apple ID? Creating a new one is not what you want to do, but if you changed the ID associated with your purchases then that might have worked. You would need to sign in with the Apple ID on both your iPod Touch as well as in iTunes. I'm not sure how you changed it but clearly they need to match.
    If it's just your password that is not getting recognized reset it here: http://iforgot.apple.com/
    It will send an email confirmation to the email address associated with that Apple ID. The email address you elect to use might not look anything like your Apple ID. If you don't appear to get an email check your spam filter.

  • I keep trying to reset an icloud account that is disabled because I forgot the password but is not able too. I tried changing it but there seem to be some mix up in the icloud ID and the gmail email address. HELP PLEASE!!

    I keep trying to reset an icloud account that is disabled because I forgot the password but is not able too. I tried changing it but there seem to be some mix up in the icloud ID and the gmail email address. HELP PLEASE!!

    Your password was sent to your emergency email address.  Perhaps you have an email you never use?   I use the free email from my cable TV account as my emergency email.
    Your Apple account and cloud account are separate.   You could even have completely different user and password.   Most of us use the same user ID and password, but they are not the same thing, don't mix them up.
    If you can't retrieve emergency email, you will have to call apple support.
    http://support.apple.com/kb/HE57

  • ICloud - Please specify a valid email address.

    Hi
    I need to change my email address associated with my Apple ID from [email protected] to [email protected]
    However, the clever logic on iCloud will not let me, telling me instead to "Please specify a valid email address."
    The email address isperfectly valid, can somebody assist with this please.
    Regards,

    It seems you can't use things like hello or info of example [email protected] will work but not [email protected] or [email protected] This is supremely frustrating can you fix this please Apple

  • My daughter has an iPod and FaceTime has stopped working as she is not able to verify her email address please can you help.

    My daughter has an iPod and FaceTime has stopped working as she is not able to verify her email address please can you help.

    As long as you can't get a hold of the device, you can't do anything more than talking to your daughter about it.
    Erasing the device could also be an option to keep her from using apps you don't want her to have on her device.
    Try talking first

  • Any service available on net to check valid email addresses?jwenting, help.

    Is there any 100% reliable service available on net to check the valid email address so that the mail should not get bounced back if sent to the email id.
    According to jwenting in previous topic, there is one service. Here are his quotes.
    Spammers would love to have such a
    service. Just send random combinations to that
    service at a rate of a hundred thousand a minute and
    you have in a few hours a complete list of all
    working addresses on the net.
    Good enough that you can repeat the process before
    every run and you're never getting bounces again.Could anybody explain what is meant by this?

    He's saying "No there is no such service". It would provide yet another haven for crappy spammers.

  • HT1349 how can I change an email for authorization, the email address we used years back, is no longer a valid email address

    how can I change an email for authorization, the email address we used years back, is no longer a valid email address

    SfromW wrote: ... how can I change an email for authorization, the email address we used years back, is no longer a valid email address
    How to change account here: http://support.apple.com/kb/PH1641
    If you need more help, start here: http://www.apple.com/support/itunes/
    SfromW wrote: ... we can't remember the password from the old email address (for authorization)...
    Help Retrieving and changing passwords here: http://support.apple.com/kb/HT1911
    If you need more help, from iTunes for Windows, click  iTunes > iTunes Store > Support
    SfromW wrote: ... apple should make it easier to transfer authorization authority....I would think anyways.
    You might want to rethink your thoughts about making transferring authority easier.  Making it too easy would certainly degrade your account's security.  If you still believe it should be easier, you can send feedback directly to Apple via http://www.apple.com/feedback/itunesapp.html
    You will not get a response, but you can be certain that the responsible Apple people will see your input for consideration in FaceTime product development.
    As a new user, please understand that you are NOT directly addressing Apple here.  For more info about Apple discussions, start here: http://discussions.apple.com/static/apple/tutorial/etiquette.html 
    Message was edited by: EZ Jim
    Mac OSX 10.7.4

  • JavaMail and Valid Email Address

    Hello All,
    I am using JavaMail API to send thousands of emails every day through my application running on J2EE application server...
    But what i really want to do is, how do i check whether a particular Email Address is Valid or not,if not valid then catch a exception and report it....
    Also i meant by Valid email address as to be exsisting on that mail server..e.g "[email protected]"...i.e.the user "javamail" should exist on that domain "sun.com"...
    Is there any way which i can do the above thing?
    Also,since i will be sending 1000's of emails every day will it be feasible for me to check each and every email whether it exist or not and then send it.....how much time will it take to do the same...
    Please help me out with this,can anybody give me a Detail desciption and Code of how can i do it...
    Any suggestions are greatly appreciated
    Thanks a million is advance
    Sam

    E-mail generally passes through a whole series of Mail Transfer Agents before arriving on the target machine, and it could be rejected at any stage.
    It may wind up waiting in a queue. It could be days before it reaches a machine that knows whether the user is valid or not.
    And machines aren't as helpful as they used to be about letting out information about available e-mail addresses,
    too many evil spammers about.
    You can test the format, though I've seen a lot of active e-mail addresses with what I believe are invalid characters in them apparently find their way through.
    In theory you could look up the domain part of the address on the DNS. If you don't find either an "A" record or a "MX" record then niether will your mail transfer agent. AFAIK there's no standard java classes for doing that but there may be some out there on the net.
    There's no sure way of validating a user name except sending a mail and see if it bounces.

  • Why can I not verify my Apple ID? I keep getting this message after trying: "the email address is alread in use or you may already have an apple id associated with this email address. please try again or sign in using your existing apple id"

    the email address is alread in use or you may already have an apple id associated with this email address. please try again or sign in using your existing apple id............ PLEASE HELP ME

    Hi all,
    I tried this and it worked:
    1) Visit My Apple ID at https://appleid.apple.com/.
    2) Click the Manage your account link on the right sideof the page.
    3) Enter the account name (Apple ID) and the password you used when creating the account.
    4) Change the email address associated with your account.
    5) Send new verification email
    I also got this from apple CS for other things to try:
    Please follow these steps to access your Apple ID accountinformation:
    1) Visit My Apple ID at https://appleid.apple.com/.
    2) Click the Manage your account link on the right sideof the page.
    3) Enter the account name (Apple ID) and the password youused when creating the account.
    4) Delete any duplicate email addresses associated withyour account.
    5) Click the Save Changes button.
    If you do not have duplicate email addresses on your account, it is possible that your email address is already being used withanother Apple ID. In order to verify your email address with the current AppleID, it will need to be disassociated from your other Apple ID. You can do thatby following these steps:
    1) Visit My Apple ID at https://appleid.apple.com/.
    2) Log in with your other Apple ID and password.
    3) Select the Manage your account link.
    4) Choose Name, ID, and Email Address from the left sideof the page.
    5) Next to Primary Email Address, select Edit so that youcan change the email address associated with this Apple ID.
    6) Once you've made the desired change, select SaveChanges.
    7) Choose Sign Out from the top right of the page.
    If you would like to have the verification email resentto you, please sign into https://appleid.apple.com/with the Apple ID you want to verify, and make sure there is not a typo in yourPrimary Email Address. Select the "Edit" link to the right of your email address to make corrections and then click the "Save Changes" button.Once the typo is fixed, or if there is no typo, click the "Resend"link under your email address.
    If you still do not receive the verification email,please reply to this email with the email address that you intend to use onyour Apple ID.
    Good luck!
    Em

  • I can't set up my email account on my ipod touch.  It keeps saying that I have to use a valid email address for this account

    I can't set up my email on my ipod touch.  It keeps saying I have to use a valid email address for this account.  Help!

    Hi Annie,
    Make sure when you are setting up your e-mail account that you enter in your entire e-mail address.  If you have a Yahoo (includes any e-mail account associated with Yahoo), G-mail, or Aol after entering in your password it should automatically set up.  Any other e-mail address you will have to manually set the account up.

Maybe you are looking for

  • How can I disable sorting in a folder? When mail arrived or move to a folder, I want that mail to show on top.

    This is mainly for my trash folder. Sometime when I accidentally deleted an email, going back to the trash folder to looking for it gives me headache. If it is on top, I know where to find it. Thanks.

  • How do I integrate a new camera into the MAX system?

    I'm working on modifying the interface to an existing camera evaluation board. The design of the interface is changing enough that the current .ICD file and .txt for the camera might need to be changed. I'd like to know what information is available

  • SQL Loader and Java

    Hi, I am using a Java Stored Procedure to invoke a SQL Loader process. The RDBMS Version is 8.1.7 on HP-UX 11. I invoke the procedure by calling: exec runcommand('sqlldr user=scott/tiger@orcl control=/home/mydir/ctlfile.ctl log=/home/mydir/logfile.lo

  • Passing values to a URL

    Hello All, i have created a php page that uploads files to the server and i call this page using a button in my apex application i've created a button that redirect to the url of this page now the problem is when calling the url i must pass parameter

  • Looking for best app to improve video on iPhone

    Hi I see Camera+ 3 and Camerawesome are apps that improve pics on iPhone and maybe Camerawesome helps video. Any opinions on apps that do it better or is Camerawesome the one to get? Thanks!