<spring:message code="footer.copyriteText" arguments="NEEDS TO BE DYNAMIC" htmlEscape="false"/>
I need to replace NEEDS TO BE DYNAMIC
with Calendar.getInstance().get(Calendar.YEAR)
. How can I achieve this using EL?
If you don't want hardcode solution like BalusC said you can use this solution
Write custom jstl tag like c:set to execute constant path and return constant value then put the constant value to Page scope. This can be done via java Reflection.
Use the tag
<lib:getConstant path='java.util.Calendar.YEAR' var='v'/>
And
arguments='${v}`
This solution can work with all constants and you may want change constant values without changing jsp code.
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.