You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Geoff Howard <co...@yahoo.com> on 2002/12/05 23:47:37 UTC

what should getRealPath return in sub-sitemap?

I have a sub sitemap mounted under a sub directory,
and within an action called from that sitemap I am
calling context.getRealPath("dir-name").

I expected it to resolve dir-name relative to the
mounted directory, returning
{webapps-dir}/{servlet-context-dir}/{sub-dir}/{dir-name}
but it resolves it relative to the servlet context.  

I have a feeling this could be because I have mounted
the subdirectory with a blank uri-prefix since it
would be undesirable with a host match mount: 

    <map:match type="host" pattern="*virtualhost.com">
      <map:mount src="vhost/" uri-prefix=""/>
    </map:match>

Is this correct behaviour?  The only discussion I was
able to dig up from the archives seemed to imply that
the context is supposed to be gained from the location
of sitemap.xmap, which would give the behaviour I was
looking for.  

Is there another way to go about this?

Am I abusing the map:mount directive using it this
way? (if so, then why bother specifying uri-prefix at
all)

Geoff Howard

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: what should getRealPath return in sub-sitemap?

Posted by Vadim Gritsenko <va...@verizon.net>.
Geoff Howard wrote:

>I have a sub sitemap mounted under a sub directory,
>and within an action called from that sitemap I am
>calling context.getRealPath("dir-name").
>
>I expected it to resolve dir-name relative to the
>mounted directory, returning
>{webapps-dir}/{servlet-context-dir}/{sub-dir}/{dir-name}
>but it resolves it relative to the servlet context.  
>

Context is a servlet context, and getRealPath works according to the 
servlet spec, resolving path relative to servlet's directory. Servlet in 
Cocoon is one, CocoonServlet, and deployed at '/' (webapp root).

Vadim


>I have a feeling this could be because I have mounted
>the subdirectory with a blank uri-prefix since it
>would be undesirable with a host match mount: 
>
>    <map:match type="host" pattern="*virtualhost.com">
>      <map:mount src="vhost/" uri-prefix=""/>
>    </map:match>
>
>Is this correct behaviour?  The only discussion I was
>able to dig up from the archives seemed to imply that
>the context is supposed to be gained from the location
>of sitemap.xmap, which would give the behaviour I was
>looking for.  
>
>Is there another way to go about this?
>
>Am I abusing the map:mount directive using it this
>way? (if so, then why bother specifying uri-prefix at
>all)
>
>Geoff Howard
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org