I have to display an URL in login page when user enters incorrect password. The URL would take the users to some other screen where they can change the password, if they want to.
I am using the following code. But its not working.
String pl = "https://passwordchange.com/";
try {
//some other code;
URL url = new URL(pl);
}
catch(NamingException ex) {
//this exception would be triggered when user enters incorrect password.
throw new NotValidException("Invalid password or account is locked. Follow the link to change password.\n" + url.getContent());
}
catch(MalformedURLException mue) {
// I KNOW THAT URL IS CONSTANT AND VALID..SO I DON'T WANT TO WRITE ANYTHING HERE.
}
This code is saying that
url is not resolved in the Exception. How do i display the url as hyperlink in browser when the user enters a wrong password.
Please let me know how to proceed.