Can anyone please suggest how to get full path in jsp?
Iam creating an image in some location in java class, and when im trying to access this location path in jsp, it is not showing the full path.
<html>
<head><title>Absolute Path</title></head>
Absolute Path is:<%= getServletContext().getRealPath("/") %>
</html>
Hope this help you
You can use real path.
String webRootPath = application.getRealPath("/").replace('\\', '/');
or
String webRootPath = getServletContext().getRealPath("/").replace('\\', '/');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With