I am working on a Spring MVC application that sends mail on a button click. I plan to generate the formatted HTML for the email in a JSP. But I am not sure how to get the output of this JSP back into the Controller (without going around the browser)
One way I thought was to make a fresh HTTP request to itself, from within the controller - and get the HTML generated by this JSP. But when I do this, the session changes and I lose the session models.
Is there some way to maintain the session in the HTTP request made.. Or some feature of Spring to handle the whole scenario in a better way?
Get jsp output in spring controller as String .. talks of something similar. But that is still unanswered.