Replacing Newline Characters in Java and JSTL

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <% pageContext.setAttribute("newLineChar", "\n"); %> <p class="text-muted"> ${fn:replace(myText, newLineChar, "<br />")} </p>

JSTL – fn:replace() Function

<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %> <%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %> <html> <head> <title>Exmaple of JSTL – fn:replace() Function</title> </head> <body> <c:set var = "string1" value = ".Maui…