cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SAXESS - Hussayn Dabbous <>
Subject cocoon-sitemap, redirects and application default context
Date Fri, 06 Dec 2002 12:33:48 GMT

I want to setup my webserver/appserver, so that it serves
a cocoon driven webapplication without exposing the cocoon
webapp in the URL and it redirects me to some initial page
of my cocoonapp. cocoon does not work as i expect in this
environment. But i found a workaround. Maybe someone could
comment on this and lead me to better understanding ?

here is what i have done in more detail:

this URL request  :
shall redirect to :

where myapp is the cocoon driven webapplication.

I use this combination of tools:

cocoon 2.0.3
apache 1.3.23
tomcat 4.1.12

1.) I have set a default context in tomcat's server.xml to cocoon
     and directed apache to forward all requests for "myapp" URLS
     to tomcat.

     Hence calls to

     are all processed by cocoon. This part of the game is
     well understood and it works as expected.

2.) I put following entries into my master sitemap.xmap:

     <map:match pattern="myapp**">
       <map:mount check-reload="yes"

     <map:match pattern="myapp/**">
       <map:mount check-reload="yes"

     By this i expect all requests for /myapp... be controlled
     by myapp/sitemap.xmap  (Although i believe, the secnd
     match will never be processed ...)

     Also this works fine. The sub sitemap is mounted ...

3.) I put following entries into the sitemap.xmap of

       <!-- homepage -->
       <map:match pattern="">
         <map:redirect-to session="false" uri="page/search"/>
       <!-- homepage -->
       <map:match pattern="/">
         <map:redirect-to session="false" uri="page/search"/>

Now, when i enter: ""
i get an error stating, that the resource "/page/search" could not
be found on my server.

When i enter:
i will be correctly redirected to
and cocoon does, what i want it to do.

After some experiments i found, that following entry in the
master sitemap.xmap lets cocoon behave as expected:

  <map:match pattern="myapp">
    <map:redirect-to session="false" uri="myapp/"/>
  <map:match pattern="myapp/**">
    <map:mount uri-prefix="myapp"
               src="myapp/" />

Now both URLs as stated above work fine.
Can anyone explain, why my first approach failed?
Or is there even a better and simpler solution for
my problem?

If this behaviour is "a feature", would this be something
to be described in the HOWTO section in the cocoon WIKI ?

best regards,

To unsubscribe, e-mail:
For additional commands, email:

View raw message