• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I get docroot from the servlet

 
Siva kandasamy
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
How do I get server's docroot from the servlet ?

What is the industry standard or the best way to locate, physical location of XSL & XML file's from the servlet as we can not hard code the absolute path of XSL & XML file in the servlet ?

thanks
siva

[ October 24, 2004: Message edited by: Siva kandasamy ]

[ October 24, 2004: Message edited by: Siva kandasamy ]
[ October 24, 2004: Message edited by: Siva kandasamy ]
 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might be useful. I tested it in a JSP though

<code>
<%
String runningPath = application.getRealPath(request.getServletPath());
String serverName = request.getServerName();
out.println( runningPath );
out.println( serverName );
%>
</code>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic