cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Skip Carter <>
Subject Re: Servlet generating an XML--->How to write the pipeline?
Date Thu, 01 Aug 2002 17:23:13 GMT

> I have a servlet which generates an xml file which in
> turn should be transformed using xslt.How do I write
> the pipeline for the same?
> Say the name of the servlet is check.class(where
> should I place the class, in web-inf?), the name of
> the xml file generated by the pipeline is test.xml and
> the stylesheet used is test.xsl.How should my pipeline
> look like?

  I handle this with any entry like the following in the main pipeline in 

      <!-- chain a servlet from tomcat -->
      <!-- note: using the request action only works for GET not for POST -->
       <map:match pattern="Servlet/*">
           <map:act type="request">
               <map:parameter name="parameters" value="true"/>
               <map:generate src="{requestURI}{requestQ
uery}" />
               <map:transform src="stylesheets/servlets.xsl" />
           <map:serialize type="html"/>

  (If somebody has a good solution for POST I'd be interested in seeing it)

  My servlets are handled directly by tomcat (which is listening on port 
8080), that way I can easily control
  access to the "raw" servlet.  But you can have cocoon handle the servlet 
instead by making the proper
  entries in the cocoon WEB-INF/web.xml file, for example:

   <!-- after the normal cocoon <servlet> entry -->

  <!-- before the normal cocoon <servlet-mapping> entry -->

	Your classes can go in WEB-INF/classes


 Dr. Everett (Skip) Carter      Phone: 831-641-0645 FAX:  831-641-0647
 Taygeta Scientific Inc.        INTERNET:
 1340 Munras Ave., Suite 314    WWW:
 Monterey, CA. 93940            

Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message