cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willie Wheeler" <wwhee...@andrew.cmu.edu>
Subject RE: My Producer worx only once...
Date Sun, 25 Jun 2000 23:17:41 GMT
Actually, it looks like it isn't doubling dummy like I thought, but just
adding the <b>...</b> and </body></html> every time you make a new
request.
Still ill-formed though.

	Willie



-----Original Message-----
From: Martin Sparenberg [mailto:ich@martins-welt.de]
Sent: Sunday, June 25, 2000 5:19 PM
To: cocoon-users@xml.apache.org
Subject: Fwd: My Producer worx only once...


Hello All,

as being new to cocoon, I tried implementing
an own producer, based on the "DummyProducer", comming as an example with
cocoon. For practicing purpose, I added some code to this class for
outputting
additional URL-parameters. When testing this producer with
"http://auriga/bla.xml?producer=TestProducer&media=blablub"
this producer worked fine requesting the Document for the first time (after
restarting the httpd).
But every then comming request, I only get
"org.xml.sax.SAXParseException: The markup in the document following the
root
element must be well-formed.",
until I restart my httpd (/ my servletengine / cocoon).

I added the code to this mail - as you see, it's just the DummyProducer a
bit
modified. BTW: that DummyProducer works well at every request...

Yours

    Martin


---------------------------------------------------------

[...]
public class TestProducer extends AbstractProducer implements Status {

    String dummy = "<?xml version=\"1.0\"?>"
        + "<?cocoon:format type=\"text/html\"?>"
        + "<html><body>"
        + "<h1 align=\"center\">"
            + "Hello from a dummy page"
        + "</h1>";
        // + "</body></html>";

    public Reader getStream(HttpServletRequest request) throws IOException {
        String para = request.getParameter( "media" );
        if ( para == null )
          para = new String( "stdBrowser" );
        dummy = dummy
              + "<b>Media: " + para + "</b>"
              + "</body></html>";
        return new StringReader(dummy);
    }

    public String getPath(HttpServletRequest request) {
        return "";
    }

    public String getStatus() {
        return "Test Producer";
    }
}
-------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org



Mime
View raw message