cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sparenberg <...@martins-welt.de>
Subject Fwd: My Producer worx only once...
Date Sun, 25 Jun 2000 21:19:12 GMT
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";
    }
}
-------------------------------------------------------

Mime
View raw message