Hello,
Is somebody able to explain why a servlet becomes in clinch waiting
for a response from cocoon? In sitemap.log I can see at the end of the
file:
. . .
DEBUG (2002-03-21) 14:58.34:460 [sitemap.generator.stream]
(/bdl/testXML) HttpProcessor[8080][3]/StreamGenerator: processing stream
ContentType= text/xmlContentLen= 72
I'm using the following part of pipeline:
<map:match pattern="testXML">
<map:generate type="stream"/>
<map:serialize type="xml"/>
</map:match>
to respond to the following servlet's request:
public String sendXML() {
String s="<html><head>OK</head><body>nothing</body></html>";
try {
URL myURL_ = new URL("http://localhost:8080/bdl/testXML");
URLConnection con = myURL_.openConnection();
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
con.setDefaultUseCaches(false);
con.setRequestProperty("Content-Type", "text/xml");
HttpURLConnection httpCon = null;
InputStream input = null;
DataInputStream dataInput = null;
try {
httpCon = (HttpURLConnection)con;
OutputStream output = httpCon.getOutputStream();
PrintStream printOutput = new PrintStream(output);
// Send XML document to cocoon's stream generator
printOutput.println("<?xml version=\"1.0\"?>");
printOutput.println("<request>");
printOutput.println("<action>getTree</action>");
printOutput.println("</request>");
output.flush();
output.close();
//******* The clinch becomes on the following line **********
InputStream istr = httpCon.getInputStream();
//******* The following code is unachievable **********
InputSource is = new InputSource(istr);
Document myDocument_ = Util.readDocument(is);
Util.writeDocument(myDocument_, s);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (httpCon!=null) httpCon.disconnect();
}
} catch (java.net.MalformedURLException murle) {
murle.printStackTrace();
} catch (java.io.IOException ioe) {
ioe.printStackTrace();
}
return s;
}
Then s string is returned as a content of servlet response to a browser.
Thank you for your help.
Roman
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>