Hi Matt,
you can
1. Save the current out, create a JspStringWriter(), set it to out,
call <jsp:forward> (note: no parameter passing) and restore
out.
2. Call the servlet via HTTP-Protokoll and use the output then.
Examples were posted on this list, or look at the
doHTTPInclude() method of JspServlet.java in a current gnujsp
snapshot, I'm using the same technique there.
3. Does it really need to be a servlet doing the HTML-Ouput?
Means: can you make slight changes so that it runs as a servlet
and as a bean? I did that lately and it made things very easy.
The only methods my service() really used were setContentType()
and getOuputStream().
So I changed it to use getWriter() and moved
nearly all of the stuff from service() (or doGET() or
what you use) do work(HttpServletRequest, PrintWriter w)
and I'm calling that from the jsp page after setting
the attributes in the request.
>I have the following situation
>
>I want to call a servlet from within my JSP page and then do something with
>the result.
>
>The servlet returns an XML string which I want the JSP page to break apart
>and insert various bits into several XML data islands on the HTML page.
>
>eg
>in the jsp I want to code something similar to the following
>
>...
><%! String theXML = ""; %>
>
><%
>theXml = theCustomerServlet?customerName="fred";
>%>
>
><XML id=theXML>
><%= theXML %>
></XML>
>
>...
>
>
>
>Any help would be greatly appreciated.
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST"
.
>FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
Ciao,
Carsten Heyl
Carsten Heyl [EMAIL PROTECTED]
NADS - Solutions on Nets http://www.nads.de/
NADS GmbH http://www.pixelboxx.de/
Hildebrandtstr. 4E Tel.: +49 211 933 02-90
D-40215 Duesseldorf Fax.: +49 211 933 02-93
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html