I am trying to StringEscapeUtils.escapeHtml(String string)
to convert the special characters on my web page to HTML entities. But it also escapes the five basic XML entities which are <, >, ", ', and &, which makes my HTML not render correctly since the mentioned characters were escaped.
So what I do after that is use StringEscapeUtils.unescapeXml(String string)
to return <, >, ", ', and & back to their single character form.
Is there any other way to do this? Like not include the 5 entities I mentioned when StringEscapeUtils does HTML escaping?