<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> ${fn:replace(article.contents,'<','<')}
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> ${fn:escapeXml(article.contents)}
tmp = article.getContents(); tmp = tmp.replaceAll("&","&"); //tmp = tmp.replaceAll("\"","""); tmp = tmp.replaceAll("'","'"); tmp = tmp.replaceAll("\"","""); tmp = tmp.replaceAll("<","<"); tmp = tmp.replaceAll(">",">"); tmp = tmp.replaceAll("\r\n","<br>"); tmp = tmp.replaceAll("\n","<br>"); article.setContents(tmp);
import org.apache.commons.lang.StringEscapeUtils tmp = article.getContents(); tmp = StringEscapeUtils.escapeHtml(tmp); tmp = tmp.replaceAll("\n","<br>"); tmp = tmp.replaceAll("\n","<br>");
<%@ taglib uri="/tags/struts-bean" prefix="bean" %> <bean:write name="article" property="contents" filter="true">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <c:out value="${article.contents}" escapeXml="true">