简体   繁体   中英

Spring JSP, one tag inside another

I want to put value of <s:message code="active.from" /> into pattern parameter of another tag like this:

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

However it ends with

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

I tried some backslashing variations, but it does not help.

I solve it with following (however I do not know, if it is the best solution) :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM