Dear cocooners,

Problem:
1. In the definition of a named block, for:
    <servlet:context mount-path="/foo" context-path="blockcontext:/foo/"/>

This tells the cocoon servlet that a block "foo" is mounted on "foo" in the
webapp.

2. sitemap.xmap
  An empty matcher like in the cocoon sample:
 <map:match pattern="">
            <map:read src="welcome.html" mime-type="text/html"/>
  </map:match>

3. call
    localhost/mywebapp/foo

   or, the root of the block. (it is configured correctly, all the rest
works).

EVENT:  exception:

For named blocks
java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at
java.lang.String.charAt(String.java:687) at
org.apache.cocoon.sitemap.node.MatchNode.invoke(MatchNode.java:89)

Without having it investigated in extenso, it seems that when blocks are
named, so not mounted as 'root block', that there is a problem with
<excerpt>
String testValue = resolvedValue == null
                ? null : resolvedValue.toString();
        if (testValue == null) {
            testValue = invocation.getRequestURI();
            if (testValue.charAt(0) == '/') {
                testValue = testValue.substring(1);
            }
        }
</excerpt>
The value is null.

By the way,
localhost/mywebapp/foo/
nicely produces the expected welcome page.

Anyone knows this problem?


Kind regards,
Jos

-- 
The doctrine of human equality reposes on this: that there is no man
really clever who has not found that he is stupid.
        -- Gilbert K. Chesterson

Reply via email to