我需要将jsp内容存储在oracle数据库中。我从数据库中检索它并将其存储在字符串中,然后通过将 escapeXML 设置为 false 来输出它,从而呈现 html。
<c:out value="${myProfileForm.skinElement.footerContent}" escapeXml="false"/>
除了最终解析为 html 而不是标签的标签之外,这工作正常:
<c:choose>
<c:when test="${displayLinks=='true'}">
<jsp:include page="header-myprofile.jsp" />
</c:when>
<c:when test="${displayLinks=='false'}">
<jsp:include page="header-no-menu.jsp" />
</c:when>
<c:otherwise>
<jsp:include page="header-myprofile.jsp" />
</c:otherwise>
</c:choose>
有没有办法将jsp标签存储在数据库中?
最佳答案
您可以通过使用像 Velocity 这样的模板引擎来实现相同的效果,而不是将 JSP 存储在数据库中。或FreeMarker .
关于java - 在数据库中存储 JSP 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4955756/