Answer the question
In order to leave comments, you need to log in
How to escape HTML tags using Java?
The data comes from the client to the Java server, then it is transmitted to other clients (output by HTML formatting) and you need to escape all HTML tags in the message, i.e. make sure that all clients perceive the string in the same way as it is written below and in the same way brought out: <b>блаблабла<b/>
How to do it?
Answer the question
In order to leave comments, you need to log in
stackoverflow.com/questions/4874626/java-escape-html
stackoverflow.com/questions/1265282/recommended-me...
Choose any
UPD
If you use jsp, then you can escape like this:
or like this:
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
${fn:escapeXml(myString)}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question