HttpServletRequest.getRealPath("/") should get the document root of your web
application.HttpServletRequest.getContextPath() should get the path (name) on which the context is mounted. ServletContext.getServletContextName() should get the description (name) of the application. Sean Dockery [EMAIL PROTECTED] Certified Java Web Component Developer Certified Delphi Programmer SBD Consultants http://www.sbdconsultants.com ----- Original Message ----- From: "Etienne" <[EMAIL PROTECTED]> To: "'Tomcat Users List'" <[EMAIL PROTECTED]> Sent: Tuesday, February 11, 2003 05:30 Subject: How can I get the web application name? > Hi, I found a way to retrieve the web application name for WebSphere I > guess. Can I do the same for Tomcat? > > Thanks. > > Etienne. > > > > > George, > > I've got a small servlet that'll show the docroot. Check out > > http://home.nc.rr.com/hygh/was/WebAppName.java > > > > Ken > > > > George wrote: > > > > > Hi, > > > In a servlet, I want to get the Web Application Name in which the > servlet > > > belongs. > > > Actually, I want to retrieve the webapp docRoot using > > > > > > I found in ServletEngineConfigDumper example the following code, but > I need > > > the webappname > > > > > > ServletEngineInfo engineInfo = > ServletEngine.getEngine().getInfo(); > > > ServletHostInfo vhinfo = > > > engineInfo.getServletHostInfo("default_host"); > > > WebGroupInfo wgInfo = > vhinfo.getWebGroupInfo("webappname"); > > > String docroot=wgInfo.getDocumentRoot(); > > > > > > Any other way to get the WebApplication Doc Root? > > > > > > Thank you > > > George > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
