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 Fri, 02 Aug 2002 17:49:10 GMT


> I have the class, Servlet.class and I have placed it
> in the Web-Inf folder.Now my main sitemap is as
> follows:
> <map:match pattern="Servlet/*">(what should be there
> in the Servlet folder?)
> <map:act type="request">
> <map:parameter name="parameters" value="true"/>
> <map:generate src=" " />(what should be the source?)
> <map:transform src="stylesheets/servlet.xsl"/>
> </map:act>
> <map:serialize type="html"/>
> </map:match> 
> My servlet generates an xml file as an output stream.
> and is the following URL be used to see the result?
> http://localhost:8080/cocoon/Servlet

Ok, let me try to help by giving a step-by-step description:

your servlet class file is located in:   WEB-INF/classes/

web.xml has:

    <servlet-name>Hello</servlet-name>        <!-- the name we will use to

refer to the servlet -->
    <servlet-class>HelloXML</servlet-class>   <!-- the actual name of the 
Servlet class -->

    <url-pattern>/internal/Hello</url-pattern>    <!-- the URL path to the
servlet  -->

sitemap.xmap has:

       <map:match pattern="HelloWorld">             <!-- the PUBLIC name of 
the servlet -->
           <map:act type="request">
               <map:parameter name="parameters" value="true"/>
                <!-- here we call the servlet that generates XML -->
               <map:generate  src="http://localhost:8080/cocoon/internal/Hello{
requestQuery}" />
               <map:transform src="stylesheets/hello.xsl" />
           <map:serialize type="html"/>

so that the Web request:  http://localhost:8080/cocoon/HelloWorld   should 
invoke this pattern

(if you know to type: http://localhost:8080/cocoon/internal/Hello   you will 
get the XML output).

Hope that is more clear for you.

 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