cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DEWEERDT Frédérik FTRD <frederik.dewee...@francetelecom.fr>
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 ?.

cocoon-users@xml.apache.org

> 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 cocoon.properties location when you call
> getInitParamater(INIT_ARGS)
> and HttpServetRequest replaces the RequestURI with what it is intended   
to
> be (ie the real path of the xml document)
>
> This works OK when I produce text/html content type but fails when I   
try
> 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   
producer.
> Could you give me a clue ?

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

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

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.
<stefano@apache.org>                             Friedrich Nietzsche
 --------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
 ------------------------- http://ApacheCon.Com ---------------------







 -----Message d'origine-----
De: Nimali (TP) [SMTP:Namalitp@insci.com]
Date: lundi 10 avril 2000 23:55
À: cocoon-dev@xml.apache.org
Objet: Help needed for using Cocoon

Hi,

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

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

Thanks a lot!
Nimali




Mime
View raw message