簡體   English   中英

Spring JSP,一個標簽在另一個里面

[英]Spring JSP, one tag inside another

我想將<s:message code="active.from" />放入另一個標簽的pattern參數中,如下所示:

<fmt:formatDate value="${campaignPerDay[0].date}" 
     pattern="<s:message code="active.from" />" 
/>

然而它以

org.apache.jasper.JasperException: /WEB-INF/views/active.jsp(200,106) equal symbol expected

我嘗試了一些反斜杠變體,但無濟於事。

我用以下方法解決它(但是我不知道,如果它是最好的解決方案):

<c:set var="dateformat" scope="page"><s:message code="general.dateformat" /></c:set>
<fmt:formatDate value="${campaignsPerDay[0].date}" pattern="${dateformat}" />

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM