• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

How do I get docroot from the servlet

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
I brought this back from the farm where they grow the tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic