<input type='text' value='${user.memo}'>
当${user.memo}的值中包含有单引号'的时候,就会因与外面的单引号冲突出错<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<input type='text' value='<c:out value="${user.name}" escapeXml="true"></c:out>'>
方法2.采用${fn:escapeXml(value)}<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<input type='text' value='${fn:escapeXml(user.memo)}'>
标签:地址:https://www.leftso.com/article/10.html