You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2015/02/10 11:37:15 UTC

[Bug 57556] New: getServletContext().getRealPath("/") returns path not ending with /

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

            Bug ID: 57556
           Summary: getServletContext().getRealPath("/") returns path not
                    ending with /
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: Specification APIs
          Assignee: dev@tomcat.apache.org
          Reporter: ps.karthic@gmail.com

I have been using this "getServletContext().getRealPath("/")" till Tomcat6 and
i got the return string path ending with slash.
For Example getServletContext().getRealPath("/") will return
E:/TomcatHome/webapps/CRM/

But when I tried with Tomcat 8.0.14 I got path without slash
For Example getServletContext().getRealPath("/") will return
E:/TomcatHome/webapps/CRM
Ending slash missing

Is there anything changed in Tomcat 8 and is there any configuration I can make
to get the result that I got in previous version of Tomcat, because if I have
to change in code, I have to change in lot of places in all the webapps I
created.

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

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


[Bug 57556] getServletContext().getRealPath("/") returns path not ending with /

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57556

--- Comment #1 from karthic <ps...@gmail.com> ---
I mentioned I used till Tomcat6, it is typo, I have been using this code from
Tomcat5.5 to Tomcat7

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

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


[Bug 57556] getServletContext().getRealPath("/") returns path not ending with /

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57556

karthic <ps...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|8.0.14                      |trunk

--- Comment #3 from karthic <ps...@gmail.com> ---
(In reply to Mark Thomas from comment #2)
> This will be the new resources implementation introduced in 8.0.x.
> 
> I don't see any reason not to restore the trailing separator for a directory
> for backwards compatibility but I say that not having looked at the code.

Mark, in that code I am just getting the path but that will be sent to another
method where the file name is added dynamically or event based.

Is there anyway I can make this work as it was previous without changing code.
If there is no workaround, then I should downgrade to Tomcat 7 .

Thanks
Karthic

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

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


[Bug 57556] getServletContext().getRealPath("/") returns path not ending with /

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57556

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Mark Thomas <ma...@apache.org> ---
Fixed in trunk for 9.0.x and in 8.0.x for 8.0.19 onwards.

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

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


[Bug 57556] getServletContext().getRealPath("/") returns path not ending with /

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57556

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
This will be the new resources implementation introduced in 8.0.x.

I don't see any reason not to restore the trailing separator for a directory
for backwards compatibility but I say that not having looked at the code.

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

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


[Bug 57556] getServletContext().getRealPath("/") returns path not ending with /

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57556

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|trunk                       |8.0.14

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

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


[Bug 57556] getServletContext().getRealPath("/") returns path not ending with /

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57556

karthic <ps...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

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

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