I have a Java file that includes a lot of validation messages. I have added some HTML tags (anchor link) in one of them as you can see below.
if (count > 0) {
//Reg Path
if (pCustomer.getCsnoemail().equals("N")) {
errorList.add(new ErrorMessage(1, "Someone has already registered using that username. Try again."));
} else {
errorList.add(new ErrorMessage(1, "Someone has already registered using that email address. Please **<a href='/account/register-or-signin'> sign in here</a>** or try again"));
}
return new Logon(0, Logon.FAIL, errorList);
}
In the browser the html anchor tag is not properly intepretted. How can I make sure my html is read in the browser? I want this change to happen in the Java file itself and not create another html file and redirect.
text/html, but you need to let us know: 1. Which framework you're using? 2. How you're sending back the response? 3. Which server are you using? Tomcat? Java is just a language, not a framework...<h:outputText escape="false" ...>. Default is true.