What is the correct way of doing it? I am new to cocoon too, but I see here serialization and deserialization done perhaps unnecessary. If the servlet used a DOMXML object to represent the outermost data, and then serialized it to give it to cocoon, it is a waste. Is there anyway to have the servlet give an XMLobject to the cocoon pipeline instead of a character-stream?
In my case, I am used to WebMacro, that is similar to Velocity from apache. In this architecture (more or less), the servlet receives a request, and then processes an action (like searching something in the database) and then puts objects in a hashtable (like a collection of javabeans representing the query result) and then invokes a template. The template can use the objects passed to the hashtable by specifying $keyname.method() for example. It has primitive logic directives as iteration, if-then-else, and a set statement in order to modify variables (this way you are forced to code well, since most of the logic must be in a java class, not in the template). This output then can be sent to the response stream, or to a file or to wherever you like (but 99% of the time you set it to the response). I like this architecture, and I would like to mix it with cocoon. So I suppose that instead of WebMacro, I should be doing similar things with an xsp, so that instead of a stream of characters I get as output an XMLobject to introduce into the pipeline. Does anybody have a simple starter example of how to do this? Because I like to decide the final pipeline (decide the template) from the servlet. As far as I could see, the usual way is to have a fixed pipeline map. Also, I need to get hold of the final xmlobject from the pipeline (instead of serializing it to the response) since I have to put this xml in a SOAP message as the final result (not a webbrowser). So what I need cocoon to be, is an invisible module that I put objects to it in some hashtable as input and a template name (or map ref, as you like), and gives me magically as output (after a pipeline of transformations with automatic-caching, etc) a nice XMLobject. Then with it I do what I like (for example put it in a soap message response/request or even put it back in a cocoon-pipeline of transformations get yet another xmlobject). Perhaps I am lost, since I managed to make cocoon2 work just today, on my tomcat 4.1.2 container on jdk1.4 I was told to look for a manifest file entry problem or rather unpack the war (I went with the second choice and was just fine). Thanks to Vadim!! http://www.mail-archive.com/cocoon-users@xml.apache.org/msg18532.html Well, I hope someone did this style of programming. Salutes, Dario. ----- Original Message ----- From: "Paul Lee" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, October 02, 2002 10:57 Subject: Re: Servlet-Ouput as Cocoon-Input > Hi Michael, > > The default generator (file) can do URL as well. > > What I've done is wrote a servlet called XMLServlet that generates some simple > XML, then add the following to the sitemap.xmap: > > <map:match pattern="reports/*"> > <map:generate src="http://<host_name>/XMLServlet?{1}"/> > <map:transform src="StandardReportWeb.xsl" type="xslt"/> > <map:serialize type="html"/> > </map:match> > > This works well for me. > > Good luck! > > Paul > > > > Hi, > > > > I am new with Cocoon and havn't done a lot with servlets yet. > > My prblem is that I want to process the output of one servlet > > with cocoon. How do I connect them? > > > > Is the request generator the correct or the stream generator? > > Any suggestions? > > > > thank you very much for your efforts, > > > > kindest regards, > > michael > > > > --------------------------------------------------------------------- > > Please check that your question has not already been answered in the > > FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> > > > > To unsubscribe, e-mail: <[EMAIL PROTECTED]> > > For additional commands, e-mail: <[EMAIL PROTECTED]> > > > > > --------------------------------------------------------------------- > Please check that your question has not already been answered in the > FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> > > To unsubscribe, e-mail: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>