I have an html template file, lets call it index.tpl, which I want to process with a java servlet. This is what index.tpl looks like:
<html>
<body>
<h1> Pet profile - {pet.name} </h1>
<p> age {pet.age} </p>
etc.
</body>
</html>
How can I make a servlet that takes this html as an input, processes it, and sends it back to the browser?
The user journey is basically:
1.User types something like webAppDomain.com/index.tpl?id=1
2.Servlet processes index.tpl and shows the filled template to the user
I'm specifically interested in knowing how the servlet can take the html code as an input to process.
I've tried searching for some way to do this, but I've literally just picked up servlets and I'm a bit lost.