I have this scenario and need some help on what's right way to do it.
I need to build an in-memory Dynamic XHTML and pass it on to itext API to convert that XHTML to PDF. Data to be inserted in that in-memory HTML tags will come from a web-service or maybe a thirparty API.
So, 2 things I need help with is
1. How to generate Dynamic XHTML without using out.println("") in Servlet?
2. What is best way to populate data from web-service into Dynamic XHTML tags?