How can I obtain the same behavior as String.format(String, Object …) in a JSP(x) page?
Is there a tag library / function library yet available for this purpose?
I need something that given a source string and a set of arguments performs the substitutions like
<ns:tag source="Hi {0} {1}" arguments="'name','surname'" />
or
${ns:func("Hi {0} {1}", "'name','surname'")}
that results in
Hi name surname
Thanks you for any suggestion,
Stefano
You’re looking for the JSTL
<fmt:message>tag:It uses
java.text.MessageFormatinternally, though.Most UI frameworks also have their own version of such a tag.