[jetty-users] render JSP from a background thread in a web app
I have a web app which I’m running on Jetty (for my CI server) and Tomcat (in Eclipse and for live deployment).
I have email templates which are rendered by Apache Tiles, which is backed by JSP pages.
I would like to send an email from a background thread in my web-app (i.e. not a request thread).
I searched around for how to render JSP pages outside of a request thread, and found e.g. , , which suggest creating a mock Request/Response, fetching the RequestDispatcher from the ServletContext and calling dispatcher.forward(request,response).
I tried this, and it works fine in Tomcat. Unfortunately it doesn’t work in Jetty.
The problem is that the org.mortbay.jetty.servlet.Dispatcher class has this line at the start of the “forward” method:
Tel : 020 7485 7500 ext 230 | Fax : 020 7485 7575
re Sunday Times Best Small Companies – UK top 20
Web : www.softwire.com | Addr : 325 Highgate Studios, 53-79 Highgate Road, London NW5 1TL Softwire Technology Limited. Registered in England no. 3824658. Registered Office : 13 Station Road, London N3 2SB