You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Julien BARRET <ju...@advantys.fr> on 2000/06/19 12:04:08 UTC

WebApps and getRealPath...

Hi,

I have 2 web applications on my tomcat server.

My first webapp (lets call it rootapp) is "/" [accessible with http://server/rootappFile.jsp]
My second webapp (lets call it app2) is "/app2" [accessible with http://server/app2/app2File.jsp]

If a servlet running in app2 tries to do a getRealPath on a file located under "/" (e.g getRealPath("/file.txt")) then getRealPath returns a wrong value. I believe this is normal, due to the separation between webapps contexts.

But if a servlet running in rootapp do a getRealPath on a file located in app2 (e.g getRealPath("/app2/file.txt")) then getrealpath returns the right value...

So is the root application a "special" webapp with sort of "super user" rights ? 



Regards,

Julien BARRET (still working on realPaths...)

ADVANTYS
julien.barret@advantys.fr