Return-Path: Delivered-To: apmail-xml-cocoon-users-archive@xml.apache.org Received: (qmail 72305 invoked by uid 500); 23 Jan 2002 17:48:15 -0000 Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-users@xml.apache.org Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 72289 invoked from network); 23 Jan 2002 17:48:14 -0000 Message-Id: <4.3.1.1.20020123123838.00a75dc0@mail.dti.net> X-Sender: darose@mail.dti.net X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Date: Wed, 23 Jan 2002 12:44:52 -0500 To: cocoon-users@xml.apache.org From: David Rosenstrauch Subject: Re: Servlet to XSL possible? In-Reply-To: <02cb01c1a431$a9cc0f00$1e01a8c0@localdomain> References: <005c01c1a370$a321f1e0$90a4558b@vgritsenkopc> <4.3.1.1.20020123115312.00e5b5a0@mail.dti.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N OK. I think I get it now. Yes, Tomcat will always handle the servlets, and since your servlet is not a Cocoon generator things won't work properly. Servlets are designed to write directly to the http response stream (which is what you are seeing). Cocoon on the other hand is designed for you to process xml elements via pipeline transformations and (eventually) serialize the output to the http response stream. So ... how to do what you want? Some ideas: 1) Kludgey: Make your servlet act as a Cocoon generator as well. Have it implement the appropriate interface and generate the appropriate XML when called. 2) less kludgey: Avoid calling a servlet completely. Refactor your servlet into 2 pieces: one that does the actual servlet call/response stuff ("doGet", etc.) and a separate component of stand-alone code that really does the meat of what you're trying to do (generate XML it sounds like). (Or alternatively, just add a new method to the servlet that you can call to retrieve the XML without going through all the HTTP stuff.) Then use a custom written Generator (or maybe even an Action or XSP) to call the new component directly and feed the results into the pipeline. Haven't thought this all through too carefully so maybe this is tougher than it sounds, but in theory I would think this should work. Any help? DR At 11:16 AM 1/23/02 -0600, you wrote: > I think what is happening is that Tomcat4.0 is handling the servlet and >not Cocoon2. ( I am not running an Apache server only tomcat ) > If I run the Tomcat servlet examples ( found in >?:\Tomcat\jakarta-tomcat-4.0.1\webapps\examples\WEB-INF\classes ) it is my >understanding that Cocoon is never involved. So for my servlet, no matter >what I do in Cocoon sitemap.xmap Tomcat4.0 handles the servlet which outputs >XML intended to be processed by an XSL processor. > If this understanding is correct then my statements dont seem >contradictory, but I admit that I dont have the big picture. > If I modify my servlet to create a temp file with /XSP/ for example in >the path and redirect to it then Cocoon2 gets it and processes it just fine. > What I want to do is not create a temp file and 'pipe' from the servlet >to the transformer and to the requestor. > I have thought that I might have to create a transformer in my servlet >and do the transformation there but it seems more elegant and generalized to >have Cocoon do this for me. > >Bob Garvey > > >----- Original Message ----- >From: "David Rosenstrauch" >To: >Sent: Wednesday, January 23, 2002 10:56 AM >Subject: Re: Servlet to XSL possible? > > > > I don't understand. First you say: > > > > "The problem appears to be that I cant get Cocoon to recognize servlets > > at all." > > > > And then: > > > > "Regardless of how I do the my Tomcat4.0 and > > Cocoon2 combination act the same way which is to present me with the XML > > created by the servlet." > > > > If you're getting presented with the XML created by the servlet, then >Cocoon IS recognizing your servlet, no? > > > > Am I missing something? What exactly is it that isn't working properly >for you? > > > > > > DR > > > > > > > > At 08:29 AM 1/23/02 -0600, you wrote: > > >Vadim, > > > The problem appears to be that I cant get Cocoon to recognize >servlets > > >at all. > > > Regardless of how I do the my Tomcat4.0 and > > >Cocoon2 combination act the same way which is to present me with the XML > > >created by the servlet. If I create a temporary file and do a redirect >in > > >the servlet with /xsp/ in the tempfile name then it works. > > > How do I increase debugging/logging messages? > > > Can you see where I should start to get Cocoon to get the servlet in >the > > >pipeline. > > >Bob Garvey > > > > > >----- Original Message ----- > > >From: "Vadim Gritsenko" > > >To: ; "'Bob Garvey'" > > >Sent: Tuesday, January 22, 2002 12:14 PM > > >Subject: RE: Servlet to XSL possible? > > > > > > > > > > > From: Bob Garvey [mailto:bobgarvey2@home.com] > > > > > > > > > > I am missing the big picture. > > > > > I want to generate data from servlet and have that output >transformed > > > > to > > > > > html for a response. > > > > > I have tried combinations on the order of: > > > > > > > > > > > > > src="http://cb:8080/examples/servlet/servlet23.{1}"/> > > > > > > > > > > > > > > > > > > > > where {1} would be the servlet name within the servlet23 package and > > > > would > > > > > specify the stylesheet. > > > > > Any quidence appreciated. > > > > > > > > This looks Ok. > > > > > > > > You must have servlet http://cb:8080/examples/servlet/servlet23.xxx, >and > > > > you should have an XSL file on the disk: >stylesheets/servlet23/xxx.xsl, > > > > when requesting "servlet23/xxx". > > > > > > > > What's the problem you are experiencing? > > > > > > > > Vadim > > > > > > > > > > > > --------------------------------------------------------------------- > > > > Please check that your question has not already been answered in the > > > > FAQ before posting. > > > > > > > > To unsubscribe, e-mail: > > > > For additional commands, e-mail: > > > > > > > > > > > > >--------------------------------------------------------------------- > > >Please check that your question has not already been answered in the > > >FAQ before posting. > > > > > >To unsubscribe, e-mail: > > >For additional commands, e-mail: > > > > > > --------------------------------------------------------------------- > > Please check that your question has not already been answered in the > > FAQ before posting. > > > > To unsubscribe, e-mail: > > For additional commands, e-mail: > > > > >--------------------------------------------------------------------- >Please check that your question has not already been answered in the >FAQ before posting. > >To unsubscribe, e-mail: >For additional commands, e-mail: --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. To unsubscribe, e-mail: For additional commands, e-mail: