Hi,
I have a
servlet that needs to capture the output of some
JSP into a (rather large)
String.
Both the JSP and the servlet reside on the same web application.
For instance, if my JSP were:
<html><body><%=2+2%></body></html>
My servlet should load it into the String:
"<html><body>4</body></html>"
Is there an easy way to achieve this ?
(It probably seems twisted and inefficient, but we need it for some ancient API).
I've considered letting the servlet open a new URL connection to the JSP (so that the servelt will imitate the behavior of a browser). But it seems cumbersome to open a new TCP connection, when the JSP is already on the same webapp...
Thanks.