getRealPath(String) returns the translation of an URL to local file system.
thus this is the wrong thingy.
to optain the url you wanted you could use the following methods from
ServletRequest / HttpServletRequest. in jsp-pages you have an instance of a
HttpServletRequest-class with the name 'request'.
so use
request.getProtocol()+"://"+request.getServerName()+":"+request.getPort()+"/
"+request.getServletPath(). play a bit around with that.

in general I would advise you (and others with basic questions in
servlet/jsp programming) to tutorial and faq-sites. one great address is
www.jguru.com

pero

-----Original Message-----
From: Osvaldo Pina [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 7:32 PM
To: [EMAIL PROTECTED]
Subject: application.getRealPath problem


Hi All,
  When I call application.getRealPath("/") in my JSP pages I get
"C:\java\jakarta\webapp\repositorio" instead of
"http://localhost/repositorio"; . Is that correct? How can I get the path for
the root of my web application?


Reply via email to