How to get my URL path?
I would like to show my current url path when I execute a jsp page.
I write a javabean file, using this method:
String currentdir = System.getProperty("user.dir");
Then print it out in my jsp page, it shows:
D:\Program Files\Apache Software Foundation\Tomcat 5.5 but my desired answer should be:
http://roamer:8080/myweb/
How can I acheive this purpose? Beside, I tried
getServletConfig().getServletContext().getRealPath("/") and it returns nothing in my jsp page, I guess the reason is I am calling this page as a java bean, not via a servlet call, thus the related object, function, method are not available. Am I right?

