cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DEWEERDT Frédérik FTRD <>
Subject RE: Help needed for using Cocoon
Date Tue, 11 Apr 2000 08:58:02 GMT
I sent this message to Stefano Mazzocchi if it can help ...

> Hi,
> I first apologize in advance if I'm not supposed to write to you for
> these kind of problems, could you simply reply indicating me where I
> should ask this question ?.

> But, let's suppose I'm talking to the rigth person :
> I'm trying to integrate Cocoon to my projet ( ie another servlet that
> serves pages like JSP does ) so I built a fake HttpServletRequest and a
> fake ServletConfig an I simply call the Cocoon servlet this way :
> in the service method of my servlet :
>  FakeServletConfig fsc = new FakeServletConfig(m_config); //m_config is
> the original config object
>  Cocoon c = new Cocoon();
>  c.init(fsc);
>  c.service(new FakeHttpServletRequest(request,
> request.getParameter("xml")), response);
> FakeServletConfig returns the location when you call
> getInitParamater(INIT_ARGS)
> and HttpServetRequest replaces the RequestURI with what it is intended   
> be (ie the real path of the xml document)
> This works OK when I produce text/html content type but fails when I   
> to produce PDF ( which is what I really need ).
> When reading the sources I saw the following note :
>     /**
>      * Dummy implementation of the HttpServletRequest class to create a
>      * fake but funtional request for the main engine.
>      * NOTE: this works only with the default file producer.
>      */
> But I can't understand why it only works with the default file   
> Could you give me a clue ?

It means that is a hack and may not work as expected... like you are

Have you considered using FOP directly to do create PDF out of your

Or, even better, move your servlet logic into a Cocoon XSP, instead of
calling cocoon as a library (which is not something I encouradge to do
for the above reasons and also for design reasons)

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
 ------------------------- http://ApacheCon.Com ---------------------

 -----Message d'origine-----
De: Nimali (TP) []
Date: lundi 10 avril 2000 23:55
Objet: Help needed for using Cocoon


We are using the Cocoon version:1_7_2.
We need to pass a XML stream(buffer) to Cocoon from another servlet and   
the HTML output.

It will be great if you can let us know how to pass the XML buffer to   
instead of giving the file location from another servlet.

Thanks a lot!

View raw message