cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suplizio <>
Subject Re: Tomcat + Cocoon (as only a renderer)
Date Tue, 12 Jul 2005 23:01:17 GMT

Thank you for your response. Sorry if I was unclear, however, your
response did help me understand somethings better. I have some
additional issues I'd like to ask your help with...I'll be much more

You did understand my question correctly: I want my servlet/jsp Tomcat
web app to "call" Cocoon to perform presentation layer rendering. I
also don't want to have to create a sitemap that encompasses my entire
(existing) application just to utilize Cocoon's rendering abilities on
these few pages; I only want to use cocoon on a page-by-page basis.
Specifically, when I want to render a tabular report I would like to
have jsp generate do the data-lookup, create the XML and pipe that to
the cocoon engine, which will then transform the document into xhtml. 

First of all, is there another way to communicate with cocoon rather
than going through the Cocoon servlet? In other words, it sounds as if
I can only use the http protocol to communicate with cocoon: the client
request first travels through my servlet, which makes requests to
cocoon servlet, which matches the URI pattern and does the appropriate
processing, which returns the output back to my servlet who kindly
renders it to the client. If this is correct, is there another way to
do this? (I can do a URL.getContent() or something for testing but I
don't know if my architects will approve of this).

Here's some background info:

I'm developing on a win2k box and my application <myApp> lives in
$CATALINA_HOME/webapps/<myApp>. In contrast to Cocoon's default
directory structure, that of my application is as follows:


I understand about modifying server.xml to point to cocoon's home,
currently accessed by visting http://localhost, context element is set

<Context path="" docBase="C:cocoon-2.1.7buildwebapp" debug="0"/>

Similarly, in the $CATALINA_HOME/conf/server.xml file myApp context is
set to:

<Context path="/myApp" reloadable="false"
workDir="C:eclipseworkspacemyAppworkorgapachejsp" />

So, after your response I did a little more digging around and found a
reference within "C:cocoon-2.1.7buildwebappsitemap.xmap" to a
mount-table.xml file (below):

<map:match pattern="../../mount-table.xml" type="mount-table">
<map:mount src="{src}" uri-prefix="{uri-prefix}"/>

Within this mount-table.xml file, I should then add:

<mount uri-prefix="myApp/" src="file://c:/eclipse/workspace/myApp/"/>

Which should delegate processing instructions to myApp's subsitemap
(c:/eclipse/workspace/myApp/sitemap.xmap). myApp is accessible at
http://localhost/myApp/  - since the context is set in the server.xml
file - but apparently its not processing the subsitemap file.

I'm attempting now to get access call the cocoon pipeline now and would
love to get your feedback/insight into the above, I'd greatly
appreciate it. I'm suffering under a pretty heavy proof-of-concept

Again, thank you.

On Mon, Jul 11, 2005 at 7:31pm Lars Huttar <> wrote:
> suplizio wrote:
> > Total newbie here. I've spent a great amount of time on the
> > How-to's and tutorials but I am still, however, facing some 
> > configuration issues that I could use help with. I have a large, 
> > complex servlet-based app using Tomcat 4.1, j2sdk1.4.2_05 and I want

> > to use and Cocoon 2.1.7 to handle all the presentation layer 
> > rendering. In managing this, I do not want to go through the Cocoon

> > servlet, but rather would like to continue to manage all session
> > through our current master servlet.
> >
> > So far, I've discovered that all webapps that use Cocoon must reside

> > in $CATALINA_HOME/webapps/cocoon/. Is there a way to keep my current

> > app at $CATALINA_HOME/webapps/, serve it up as is but only leverage

> > Cocoons rendering capabilities? I hope that makes sense.
> >
> > If someone please point me into a direction where I read about using

> > Cocoon without making my current application entirely a Cocoon app
> > appreciate it.
> >
> > Respect,
> > J
> >
> I'm not sure I understand the whole question, but I can tell you that

> not all Cocoon apps have to reside under
> You can put map:mount entries in your Cocoon sitemap, or in a separate

> mount table, to point to Cocoon apps anywhere. Nor does Cocoon itself

> need to reside in $CATALINA_HOME/webapps/cocoon/; you can set the path

> attribute on the Context element in your Tomcat conf/server.xml file
> point anywhere.
> But I'm not sure what Cocoon apps' location on the disk has to do with

> using your current servlet-based app with Cocoon. As I understand it,

> you want your servlet-based app to "call" Cocoon for presentation
> rendering. If your app can do a GET on a URL and receive the response,

> then your app can call Cocoon pipelines, e.g. via 
> http://localhost/cocoon/myCocoonRendererApp/params. Then it doesn't 
> matter where Cocoon resides on disk, it only matters how Cocoon and 
> Tomcat are configured to process URLs.
> Am I understanding your question right? If you can elaborate, I can 
> probably provide more details.
> Lars
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message