You can try using javax.servlet.RequestDispatcher or in the worst case you
can open up a java.net.HttpURLConnection to the servlet and grab the
returned data. I'm pretty sure that there is a struts taglib that will do
the latter too.

Troy

-----Original Message-----
From: Robert E. Baker [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 5:46 PM
To: [EMAIL PROTECTED]
Subject: Invoking a servlet from JSP


I have a self-contained servlet that returns a single value.  I am trying to
include the output of this servlet in-line on an HTML/JSP page.  When I try
to invoke the servlet using the following JSP INCLUDE tag, the page bombs
with Exception #500 (java.lang.IllegalStateException: Writer is already
being used for this request):

<jsp:include page="/servlet/TestServlet" flush="true">
   <jsp:param name="type" value="apples" />
</jsp:include>

But when I use the JSP FORWARD tag, the servlet and page work perfectly,
except for the fact that the page returned contains only the output of the
servlet (as expected):

<jsp:forward page="/servlet/TestServlet" >
   <jsp:param name="type" value="apples" />
</jsp:forward>

How can I accomplish what I need?  BTW, I am using Tomcat 3.2.1.

Thanks,
Bob


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to