cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Nasty bug in Tomcat prevents Cocoon operation
Date Thu, 16 Dec 1999 11:41:21 GMT
Tomcat has bugs in servlet mapping, like almost any other servlet
engine.

(guys, this is why some of you were 404 problems with cocoon under
tomcat, it's not our fault)

If I access the URL

 http://locahost:8080/cocoon/samples/index.xml

which is mapped to the "org.apache.cocoon.Cocoon" via this web.xml file

<web-app>
 <servlet>
  <servlet-name>org.apache.cocoon.Cocoon</servlet-name>
  <servlet-class>org.apache.cocoon.Cocoon</servlet-class>
  <init-param>
   <param-name>properties</param-name>
   <param-value>cocoon.properties</param-value>
  </init-param>
 </servlet>
 <servlet-mapping>
  <servlet-name>org.apache.cocoon.Cocoon</servlet-name>
  <url-pattern>*.xml</url-pattern>
 </servlet-mapping>
</web-app>

[yes, Cocoon is working correctly and I get the status file]

I should be able to access the file "samples/index.xml" via

  ServletContext.getResource(HttpServletRequest.getServletPath());

since the servlet path is, in this case, correctly returned as
"samples/index.xml", instead, this gives me

  [path-translated]/org.apache.cocoon.Cocoon

which doesn't mean anything at all and doesn't even exist!!! What's the
point of returning a resource that doesn't exist?

Look that I tried also

  HttpServletRequest.getRealPath(HttpServletRequest.getServletPath());
  ServetContext.getRealPath(HttpServletRequest.getServletPath());

and all return the same thing.

I continue to think the Servlet API mapping model is a total mess, but
who am I to judge such thing? :) 

at least, let's make it possible for a servlet to get access to the file
that triggered its execution.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche


Mime
View raw message