I was reading Marty Hall's book on Servlets and Jsp and I thought that he mentioned that one could include the html generated by a servlet in a jsp page by using the <jsp:include> tag. I tried it but it generated an exception. Does anyone know if this can be done?
i think i remember something about response.sendRedirect() where the servlet can provide part of the response then redirect to another servlet or a jsp to finish it. its been a while so im not sure. ------------------ Dont blindly believe everything I say.
I'm specifically referring to the jsp:include tag. I know that you can use it to include other html pages, so I would think you would be able to use it to see the generated html of a servlet. Anyone else got any ideas?? Thanks for your help though, Randall. -Sean
I tried to do something similiar to this a whila back, but I got a IllegalStateException error every time. I think the problem is that the data must be transferred from the servlet to the jsp before the jsp's buffer is written. Something you might want to try is to put the html from the servlet into a variable and do the include as one of the first things in the JSP before the buffer is written. Let me know if this works or what solution you come up with, I am interested in how this would work. [This message has been edited by Jeff Sunder (edited August 08, 2001).]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Including html generated by Servlet in jsp