Vicky Vicky - 1 month ago 6
Java Question

How to create dynamic Template String

Is there is any API which replace template string along with values using Spring or java.

For example:

Dear %FIRST_NAME% %LAST_NAME%,
---- remaining text-----------


where parameters (
FIRST_NAME
,
LAST_NAME
) in the form of
Map
.

Answer

My favorite templating engine is Apache Velocity

Integrates nicely with Spring as well, theres an introductory article here