Joe,
    When I was frustrated trying to get my servlets to work, my solution was
to instantiate a transformer from within the servlet and not use Cocoon.
This may be the best solution anyway because of performance.  It is
straightforward.  An example I think in Oreilly, 'Java and XSLT',Burke
Chapter 5.  examples available from Oreilly site.

Bob Garvey



----- Original Message -----
From: "Hall, Joe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 30, 2002 9:48 AM
Subject: RE: Servlets and Cocoon2.


> I think servlets may not be the solution.
> The developer docs for Cocoon 2 are not complete.
> What is the recommended way of running Java code in Cocoon2 without the
use
> of XSP?
>
> I haven't seen any documentation on this or how to configure Cocoon to run
> it after I write the code.
> I have existing Java code that is currently in servlets.  I would like to
> get it to run in Cocoon.
> In Cocoon 1 we used Producers.  What's the equivalent of a Producer in
> Cocoon 2?  Will I still have access to the HttpRequest object?
>
> How would you do this?
>
> Thank you all very much for your help.
>
> Joe Hall
>
> -----Original Message-----
> From: Chitharanjan Das [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 29, 2002 7:22 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Servlets and Cocoon2.
>
>
> Hello,
> Is the package information for the servlet classes
> testcocoonproject ?
> I think just by copying the class files into a subdirectory of
> WEB-INF classes is not sufficient, the servlet classes should have the
> necessary package info ...
>
> Regds,
> Chiths
>
> I saw this message in the archives, but I can't seem to get servlets and
> Cocoon2 to work.
> I think my problem is getting the servlet to run.  It's like it is not
> in
> the classpath.
> I have my servlet in WEB-INF\classes\testcocoonproject\TestServlet.
> Here's the entry from my sitemap file:
>   <map:match pattern="testcocoonproject/*">
>      <map:generate
> src="http://localhost:9090/Cocoon/testcocoonproject.{1}"/>
>      <map:transform src="stylesheets/page/simple-page2html.xsl"/>
>      <map:serialize type="html"/>
>    </map:match
>
> I would expect when I enter the URL
> (http://localhost:9090/Cocoon/testcocoonproject/TestServlet) that the
> servlet would execute but I get a an error message.  It picks up the
> testcocoonproject/*, but TestServlet yeilds the same result as any other
> non-existant name.
>
> org.apache.cocoon.ProcessingException: Could not read resource
> http://localhost:9090/Cocoon/testcocoonproject.TestServlet
>
> Do you have any suggestions on how to get this to work or samples of
> servlet
> output to Cocoon for XSL Transformation?
>
> Thanks,
>
> Joe Hall
>
> --------------INCLUDED MESSAGE FROM THE COCOON
> ARCHIVES-------------------
> Yes, working now.  I sent the following yesterday.  Thanks very much for
> your help.
>
> Thanks to Vadim Gritsenko and David Rosenstrauch.
> This scheme now works.
> Here is what I learned that may be valuable to others who would like to
> write servlets that output XML and would like for the XML to be input to
> an
> XLS Transformation.
>
> The sitemap entry:
>    <map:match pattern="servlet23/*">
>      <map:generate src="http://cb:8080/examples/servlet/servlet23.{1}"/>
>      <map:transform src="stylesheets/servlet23/{1}"/>
>      <map:serialize type="html"/>
>    </map:match>
> ---------------------
> where
> . servlet23 is a package name; this makes the matching straightforward.
> . the generate src entry is the servlet as externally referencable: note
> that if you address it from a browser you will get xml that you can look
> at
> for debug
> . the stylesheet is pathed from cocoon root.
> ---------------------------------------------------------------------
> Debugging required looking at:
> the logs in %tomcathome%\logs
> and %tomcathome%\webapps\cocoon\WEB-INF\logs
> ------------------------------------------------------------------------
> ---
> Thanks to all developers for a great system.
>
> ---------------------------END INCLUDED
> MESSAGE-------------------------------------------------
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.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/faqs.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/faqs.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/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to