cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Skip Carter <s...@taygeta.com>
Subject Re: Servlet generating an XML--->How to write the pipeline?
Date Fri, 02 Aug 2002 17:49:10 GMT

Kavitha,

> 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>
    <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 -->
  </servlet>

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



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:act>
           <map:serialize type="html"/>
      </map:match>


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: skip@taygeta.com
 1340 Munras Ave., Suite 314    WWW: http://www.taygeta.com
 Monterey, CA. 93940            












---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message