I have a batch job that runs outside any request, response scope.
I would like to be able to define the email content in JSP since the email content is primarly an HTML document with placeholders for values.
Basically, I would like to be able to run a JSP from a static method.
Is this possible? The solutions online suggests having access to a request and response, implementing httpservlet. Can I not fake these?
I know this is a difficult question, but it would feel good to find a solution for it.
JSP as a view technology is inseparably tied to the HTTP request/response cycle. You’re better off using some other templating engine such as FreeMarker to generate the e-mail message body.