【问题标题】:Storing JSP Tags in a Database在数据库中存储 JSP 标记
【发布时间】:2023-03-27 21:18:01
【问题描述】:

我需要将 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 标签?

【问题讨论】:

    标签: java oracle jsp tags jsp-tags


    【解决方案1】:

    您可以通过使用像VelocityFreeMarker 这样的模板引擎来实现相同的目的,而不是将JSP 存储在数据库中。

    【讨论】:

    • 谢谢。似乎是长期的解决方案。在短期内我必须使用一个jsp
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-30
    • 1970-01-01
    • 2014-03-07
    • 2012-02-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多