ServletContext not giving me real path when i want to go up level directory up

Posted by Nitesh Panchal on Stack Overflow See other posts from Stack Overflow or by Nitesh Panchal
Published on 2010-05-07T04:12:57Z Indexed on 2010/05/07 4:18 UTC
Read the original article Hit count: 269

Filed under:
|
|

Hello, Why does ServletContext#getRealPath() not return me correct path if i use ../

This code works :-

System.out.println(context.getRealPath("/"));

This one doesn't :-

System.out.println(context.getRealPath("/.."));

How can i get one level up directory from getRealPath()?

© Stack Overflow or respective owner

Related posts about java

Related posts about web