https://bz.apache.org/bugzilla/show_bug.cgi?id=57556

--- Comment #10 from James Ching <james_s_ch...@yahoo.com> ---
Is it also by design to change the behavior of ServetContext.getRealPath("")
(now always appended with trailing slash) and discontinue support for
ServetContext.getRealPath(".") and its variations?

In Tomcat 7.0.41, getRealPath("") returns webapp root without trailing slash,
and naturally getRealPath("/") comes with a trailing slash. getRealPath(".")
returns webapp root appended with ".", same result as getRealPath("/.").  

E.g. in Windows
ServletContext.getRealPath("")      returns C:\\path\\to\\webapp\\root
ServletContext.getRealPath("/")     returns C:\\path\\to\\webapp\\root\\
ServletContext.getRealPath(".")     returns C:\\path\\to\\webapp\\root\\.
ServletContext.getRealPath("./")    returns C:\\path\\to\\webapp\\root\\.
ServletContext.getRealPath("/.")    returns C:\\path\\to\\webapp\\root\\.
ServletContext.getRealPath("./foo") returns C:\\path\\to\\webapp\\root\\.\\foo

In Tomcat 8.0.28, ServletContext.getRealPath("") always contains trailing slash
and getRealPath(".") returns null and any path starting with it.  Also
counter-intuitively, getRealPath("/.") returns webapp root without the trailing
dot nor slash.

E.g. 
ServletContext.getRealPath("")      returns C:\\path\\to\\webapp\\root\\
ServletContext.getRealPath("/")     returns C:\\path\\to\\webapp\\root\\
ServletContext.getRealPath(".")     returns null
ServletContext.getRealPath("./")    returns null
ServletContext.getRealPath("./foo") returns null
ServletContext.getRealPath("/.")    returns C:\\path\\to\\webapp\\root

Is it possible to restore previous behavior as in Tomcat 7?  (This is inclusive
of the reported behavior above)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to