开发者

Storing JSP Tags in a Database

I have a requirement to store jsp content in a oracle database. I retrieve it from the database and store it in a string and output it by setting escapeXML to false which renders the html.

<c:out value="${myProfileForm.skinElement.footerContent}" es开发者_StackOverflow中文版capeXml="false"/>

This works fine except for tags which end up resolving as html and not tags for example:

        <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>

Is there a way to store jsp tags in a database?


Instead of storing JSP in database you can achieve the same thing by using a Templating Engine like Velocity or FreeMarker.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜