How can I get the web application's context root?

I have a web application, which is defined in Tomcat's server.xml:
<Context path="/cbes" docBase="e:\work\GM\code\CBESCurrency" debug="0"
reloadable="true" crossContext="false"/>
And I hava a servlet in this web application.
How can I get the context root of the web application?
in this example: reture should be "cbes" or "/cbes"
how?
thanks alot.

getContextPath() in javax.servlet.http.HttpServletRequest

Similar Messages

  • How do you get the web application path from the servlet?

    I have created a web application which is installed in
    /webapps/myApplication
    /webapps/myApplication/data/users.xml
    /webapps/myApplication/WEB-INF/classes/myServlet
    How can you get the path to the "users.xml" file from the "myServlet" file?
    The code below doen's seem to return the xml file. anybody knows why?
    public class myServlet extends HttpServlet {
    public void doGet( HttpServletRequest req, HttpServletResponse res ) throws ServletException, IOException
    File myXmlFile = new File("/data/users.xml");

    Try this..
    String FileName = getServletContext().getRealPath("\\data\\users.xml");
    File myXmlFile = new File(FileName);
    hope this helps..

  • How can we get the web cam to work with sykpe or any out going calls

    can get the web cam to work with skype

    Hey there,
    What model laptop is this? Are you using the built-in webcam or is this a external web cam? Also what operating system are you using?
    Thanks!
    Sean
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • How can I know the web application name of a report?

    Hi forum,
    I have a query that is used by web. I need to know the name and how to access to application web of report
    any idea
    thanks in advance

    Hi,
    If you know the Query name,you can get name of the webtemplate from metadata repository.
    go to RSA1>MetadataRepository>click 'Query'>it will display all the Queries>search for your Query (cntrl+F)-->cliclk on it. You can see the Workbooks,webtemplate,chars,kfs...etc which are related to this Query.
    thanks

  • How can I get the web page translated to English?Im translator is not doing anything.I was getting this feature with Google Chrome and Maxthon.

    Recently i have installed the latest version of Firefox.Iwas happy to find imtranslator feature in this version.But in necessity it does nothing.At many times when i was confronted with webpages in German and Chinese I tried to get translated them to English using imtranslator.But there is no response from it.Previosly I was using Google Chrome and Maxthon.They were doing this just with the click of a button.But Firefox disappoints me.Actually I am thinking of reverting to Maxthon.If there is a way for translating webpages in full in Firefox please advise so that I can stick on.
    Thanking you,
    pnsdhrn

    How do I remove IM Translator?

  • How can i get the realpath of my web application in jsf manage bean

    in jsp, i can use application.getRealPath("/")
    but in jsf how can i get the realpath in manage bean and initializean variable.
    thanks

    FacesContext aFacesContext = FacesContext.getCurrentInstance();          
    ServletContext context = (ServletContext)aFacesContext.getExternalContext().getContext();
    String rootpath = context.getRealPath("/");
    i use the code like that ,it can work , but when i click a button in my web page and call a function of java bean to read a file in "rootpath" , only odd number click it do well , even number click it do nothing and navigate to a blank page.
    how can i do that ,.
    my english is too pool ,sorry.

  • How can i get the id of the external application in my portlet??

    How can i get the id of the external application in my portlet??

    Hi Alf,
    I am not sure that you can get that information from within JPDK.
    thanks,
    Harsha

  • How can I get the receipt of my old purchases in particular application?thank you

    how can I get the receipt of one of my oldest purchased in particular application?
    thank you

    If you no longer have the original email receipt for it then all you can do is try and find it in your account's purchase history and (depending upon what you need it for) either copy it's details or take a screenshot : log into your account on your computer's iTunes via the Store > View Account menu option, you should then see a Purchase History section with a 'see all' link to the right of it, click on that and you should then see a list of your purchases.

  • Hi, I purchased apple applications and did not receive receipt, how can I get the receipt?

    Hi,
    I purchased some apple applications and already paid for this in my credit card, but I did not get receipt for it.
    The purchase was on July 5, 2012.
    How can I get the receipt for this purchase?
    Thanks!

    Call the Apple Store and inquire. I believe I read that it can take several weeks for them to send the card, but I'm not certain. The store should be able to tell you.
    Regards.

  • How can I get the Application DVD for IMAC Late 2009?

    How can I get the Application DVD for IMAC Late 2009?

    Disk 2 of the original disks that came with the computer?
    Call Apple, give them your computer serial number, and they will ship you disks for a small charge if disks are available. Go to the Apple Store for your country, then to the bottom of the page//Contact Us for the correct telephone number.
    If that isn't what you ant, can you provide more information?

  • How can i get the path to config folder placed inside the jar file?

    Hi i have developed an RCP application using eclipse.
    In my application config directory is there.
    When i export my RCP application as JNLP Project the jar file is created which contains config folder inside it.
    When i download the application using java web start , how can i get the path to config folder placed inside the jar file?
    Will the config folder exists in local cache in my system?
    Help needed.
    -Deepak

    -- This works in CS6:
    tell application "Adobe InDesign CS6"
      set myDocument to active document
      set selectedRectangles to selection of myDocument
      set theGraphicsLink to file path of item link of (graphic 1 of (item 1 of selectedRectangles))
    --> "Macintosh HD:folder/folder/filename.tif"
    end tell

  • I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in

    I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?

    For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
    For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
    See: 
    http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html  
    Be well...

  • How can i get the Adobe plug in to work with Visio 2013?

    I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues visio 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?

    Should have purchased XI. According to Compatible web browsers and PDFMaker applications you will need Acrobat 11.0.1 -and- to be running the 32-bit Visio.

  • I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio

    I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?

    For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
    For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
    See: 
    http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html  
    Be well...

  • How can i get a java application

    how can i get a java application on my mac pro?

    I'm not sure I understand the question. If the application is a standalone applet, you download it as you would any other application or file. If the applet is embedded in a web site, just go to the appropriate web page.
    If you can provide more specifics about what it is you are trying to download/accomplish, perhaps we can be of more specific assistance.
    Regards.

Maybe you are looking for

  • Question regarding MM and FI integration

    Hi Experts I have a question regarding MM and FI integration Is the transaction Key in OMJJ is same as OBYC transaction key? If yes, then why canu2019t I see transaction Key BSX in Movement type 101? Thanks

  • Read Statement in Dynamic Internal Table?

    Hi, Is it possible <b>read</b> statement in <b>Dynamic Internal</b> table? Thanls, Suresh.

  • Aperture tip for duplicating smart albums structure?

    I have folders setup for each year 1996...2012.  In the last couple of years I've created smart albums w/i each folder:  01 Jan 2012; 02 Feb 2012; etc. It's a simple smart album based on date.  I want to copy these smart albums to each year. But I ha

  • Problems with Proofing Tools 15.0.4420.1017

    Hi, I`m having problem with installation of Proofing tools 2013 version 15.0.4420.1017, thing is when I install it on Windows 8 x64 OS where Office 2013 presents I cannot identify that version 15.0.4420.1017 of proofing tools has been installed. I di

  • Alternatives to "explore" / profile BW cube

    We have implemented Solution Manager Diagnostics which is generating cubes in the Solution Manager onboard BW system.  Our goal is to expand on (customize) the existing dashboards that SAP supplies with Solution Manager. Towards this end we are tryin