私は最終的に次のコードで問題を管理します:
<c:set var="myContent" value="${row.content}"/>
<c:set var="singlequote" value="'"/>
<c:set var="backslash" value="\\"/>
<c:if test="${fn:contains(myContent, singlequote) && !fn:contains(myContent,backslash)}">
<c:set var="search" value="'" />
<c:set var="replace" value="\\'" />
<c:set var="myContent" value="${fn:replace(myContent, search, replace)}"/>
</c:if>
<c:if test="${fn:contains(myContent, backslash) && !fn:contains(myContent,singlequote)}">
<c:set var="search" value="\\" />
<c:set var="replace" value="\\\\" />
<c:set var="myContent" value="${fn:replace(myContent, search, replace)}"/>
</c:if>
<c:if test="${fn:contains(myContent, singlequote) && fn:contains(myContent,backslash)}">
<c:set var="search" value="\\"/>
<c:set var="replace" value="\\\\" />
<c:set var="myContent" value="${fn:replace(myContent, search, replace)}"/>
<c:set var="find" value="'"/>
<c:set var="change" value="\\'" />
<c:set var="myContent" value="${fn:replace(myContent, find, change)}"/>
</c:if>
<script language="JavaScript" type="text/JavaScript">
window.addEventListener("load", function(){
element.innerHTML='${myContent}';
}, true);
</script>