cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <KPiroum...@flagship.ru>
Subject [C2] Source path relative to servlet context
Date Thu, 30 Aug 2001 14:10:41 GMT
Hi, all!

Can anybody help me with path resolution? I need a path relative to the
servlet context, which I will pass to JspEngine/JspServlet for processing.
In my sitemap I have:

<map:match pattern="test/welcome.htm">
     <map:read src="path-to-jsp/welcome.jsp" type="jsp"
mime-type="text/html"/>
</map:match>

When I use an absolute path path-to-jsp = "/jsp/welcome.jsp" then this
resolves to "file:/jsp/welcome.jsp" and I strip the "file:" and pass
"/jsp/welcome.jsp" to JSPEngine and this works.

When I use path-to-jsp = "context://jsp/welcome.jsp" the path resolves to an
absolute path, say: "file:/C:/tomcat/webapps/cocoon2/jsp/welcome.jsp" and
JspServlet calls getRealPath() with this and gets the path prefixed with
servlet context path twice. And of course it gives File Not Found error.

The same thing happens with relative path path-to-jsp-dir =
"jsp/welcome.jsp". I get an exception because of a wrong file path and File
Not Found error is returned.

So, to conclude all this: I need a path relative to the servlet contex.
/jsp/welcome.jsp ==> /jsp/welcome.jsp
jsp/welcome.jsp ==> <request-path>/jsp/welcome.jsp
context://jsp/welcome.jsp ==> /jsp/welcome.jsp
etc.

Are there any hints where do I start? Somewhere in URLFactoryImpl?

Any help is very appreciated.

Regards,
    Konstantin Piroumian




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


Mime
View raw message