Probelm in getting absolute path of the application folder?

I have problem in getting the absolute path of the application folder.
I wriiten the following line in my action class:
String absPath = getServlet().getServletContext().getRealPath("/");
when i run my application 'DTH' in Tomcat server, I am getting correct path :
C:\Tomcat\jakarta-tomcat-5.0.25\webapps\DTH
But when i run this application in weblogic server, I am getting null value for the above line.
Can any one help me in this?

public java.lang.String getRealPath(java.lang.String path)
This method returns null if the servlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made available from a .war archive).
so, getRealPath() might not be a very good approach because of its different behavior when used from a war or exploded application.
What you could do is:
1. pass the path as a parameter inside web.xml (config files, log files etc)
2. For dynamic lookup of files you could make use of ClassLoader.getResource().
Hope it helps.

Similar Messages

  • How to get absolute path of a form within the Forms

    Aslam o Alikum (Hi)
    How to get absolute path of a form within the Forms 6i or 9i
    For example
    i am running a from "abc.fmx" from C:\myfolder directory
    can i get the form path 'C:\myfolder' by calling any any function from "abc.fmb"

    There is no direct call that will always work. What you need to do is call get_application_property(current_form). This may have the full path in it, depending on if that path was defined when the form was launched. If there is no path, then you need to use TOOL_ENV.GETVAR to read the Forms<nn>PATH and the ORACLEPATH, parse those out into individual directories and then check for the FMX in each.
    I already have some code to do all this for you see:
    http://www.groundside.com/blog/content/DuncanMills/Oracle+Forms/?permalink=4A389E73AE26506826E9BED9155D2097.txt

  • F4 help for file path in the Application server

    Hi All,
    i want to provide the F4 help so as to enable us to give the file path in the application server (AL11). I'm in version 4.0
    Regards
    Shekhar

    Hi
    Copy paste the following code and see the result
    Here you can see 2 types of open dialogs
    1. Directory View
    2. File View
    Use any one as per your requirement.
    DATA : l_filetable TYPE filetable,
           l_rc TYPE i.
    DATA: l_folder TYPE string,
          l_file TYPE string.
    PARAMETERS: p_folder(100) TYPE c,
                p_file(100) TYPE c.
    *Provide a Dialogue box for getting a folder path
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_folder.
      CALL METHOD cl_gui_frontend_services=>directory_browse
        EXPORTING
          window_title    = 'Select Folder Path'
          initial_folder  = 'D:\'
        CHANGING
          selected_folder = l_folder.
      p_folder = l_folder.
    *Provide a Dialogue box for getting a file path
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title      = 'Select a Text File'
          initial_directory = l_folder
        CHANGING
          file_table        = l_filetable
          rc                = l_rc.
    Reward points generously
    Regards
    Akshay Chonkar
      READ TABLE l_filetable INTO p_file INDEX 1.
      CHECK sy-subrc <> 0.

  • How to get absolute path of current directory?

    Hi, everyone!
    I want to get the absolute path of current directory.
    Are there some APIs that I can use?
    Thanks in advance,
    George

    Hi, dheeraj_tak buddie!
    What do you mean in your reply?
    "in File class u have all this methods for getting absolute path "regards,
    George

  • I am trying to download firefox5 and the download failed, and getting message To close the application -Rundell32.exe and Ox0000142

    Trying to download firefox 5 and the download failed i am getting message to close the application and cod number Ox0000142, is have any way to fix the problem with out removing window 7

    Open the Java pane in System Preferences. A separate application will launch. In the Security tab, check the box marked
    Enable Java content in the browser
    If necessary, adjust the Security Level slider, but if you must reduce the level, do so only temporarily and only if you are absolutely sure of what you're doing. Don't do this to play a game or because a stranger on the Internet asked you to. Java can be dangerous.
    If your browser is Safari, you may also need to make changes to the plugin settings in the Security tab of its preferences window.

  • Getting Absolute path

    how to manipulate or to change the folowing absoulute path
    to worrk in web browser
    String p = C:\Program Files\Tomcat\webapps\myApp\tempData\regards

    This sounds more like a web application problem than a Java problem. In general, most if not all web servers will ONLY serve files that exist in a relative path below the root directory of the web service. This is for security reasons so that outsiders can't just wander around on the server's hard disk at will.
    HOWEVER, some do allow access to absolute paths IFF the access rights to those paths are set properly for the user the web server runs as.
    I would suggest you post your question on a forum oriented toward the web server you are using, or contact your web host's support department (not usually fruitful for these types of problems).

  • Getting absolute path of a file running in remote machine

    Hi,
    I want to get the absolute path of a file that will be created in the remote server. Inside a directory XYZ in remote machine, the file will be created and the remote machine's address is xxx.xx.x.x. I have used the following snippet
    File f=new File(Filename);
    f.getAbsolutePath();
    Now, in the output am getting the absolute path of the file as d:/XYZ/Filename. Is there any way to get the output as xxx.xx.x.x/XYZ/FileName ? Can someone please suggest why the server details are not fetched and instead the directory name is fetched.
    I am running the program to get absolute path of a file in my remote machine. and for accessing that remote file from my machine, I use xxx.xx.x.x/XYZ/FileName.
    Thanks in advance.

    I'm going to take it a step further and guess at what the OP is going to say next.
    On host w.x.y.z there's a file /a/b/share/some_dir/file.txt.
    Host w.x.y.z is sharing the /a/b/share/ directory as SHARE.
    Client mounts \\w.x.y.z\SHARE as D:, so that he sees D:/some_dir/file.txt.
    OP now wants to know not just that D:/some_dir/file.txt is \\w.x.y.z\SHARE/some_dir/file.txt, but also wants to know that on w.x.y.z, SHARE corresponds to /a/b/share.
    @OP: If that's what you want, forget it. Part of the premise of file common drive/directory sharing protocols is that the client does not know or care and does not need to know or care what the absolute path is on the serving host. It's none of his business.

  • Getting absolute path of webapps directory

    Hi,
    Using a Tomcat server, i would like to get the absolute path of the Tomcat/webapps/ directory in one of my JSP pages, without using functions related to Servlet context...is it possible?
    In fact my real problem is that i want to open an existing text file in my JSP page. To do so i need the absolute path of it. This file must also be stored in Tomcat/webapps.
    Can anybody help me? i've search the forum and found some others topics like this one but didn't find my answers.
    Thanks

    Hi,
    Using a Tomcat server, i would like to get the
    absolute path of the Tomcat/webapps/ directory in one
    of my JSP pages, without using functions related to
    Servlet context...is it possible?
    Any specific reason for not using ServletContext's getRealPath() method ?
    In fact my real problem is that i want to open an
    existing text file in my JSP page. To do so i need
    the absolute path of it. This file must also be
    stored in Tomcat/webapps.Hmm,, file i/o is evil. You could use the methods of Class and ClassLoader to read in the file as a stream. The only requirement is that they be in the classpath.
    More info here - http://www.javaworld.com/javaqa/2003-08/01-qa-0808-property_p.html
    cheers,
    ram.

  • Print program is not getting triggered when saving the application

    Hi all,
    My requirement is when i save the invoice using VF01 the print program should get triggered.
    The print program is not getting triggered when saving the application even when i have configured the outtype and have attached the print program.
    The setting "send immediately (when saving application)" is also checked.
    I need to configure it for VF01 transaction.
    The error message displayed was " please maintain output device in master data".
    Regards,
    Umesh

    Hi Umesh
    Please check if you have missed any of the following:
    1. Defining Access Sequence(can use existing).
    2. Defining Output Condition Type(can use existing). - Assigning the Driver Program and Form in processing routine.
    3. Output Determination Procedure
    4. Assign Output Procedure to Billing Types
    Kind Regards
    Eswar

  • Itunes won't open and i am getting this error message: the application itunes quit unexpectedly. the problem may have been caused by the libgnsdk_dsp.1.9.5.dylib plug in

    Have not changed any settings on my mac. Quit the application end of the day. The next day I went to start it and it won't open. Everytime I try to launch it, it won't open and I get this error message: The application itunes quit unexpectedly. The problem may have been caused by the libgnsdk_dsp.1.9.5.dylib plug in

    Have not changed any settings on my mac. Quit the application end of the day. The next day I went to start it and it won't open. Everytime I try to launch it, it won't open and I get this error message: The application itunes quit unexpectedly. The problem may have been caused by the libgnsdk_dsp.1.9.5.dylib plug in

  • I have a mac book pro.  Yesterday the mail app failed to open.  I have tried to open it fomr the dock and the application folder but nothing happens.  Does anyone have any suggestions to get it to work?

    I have a mac book pro.  Yesterday the mail app failed to open.  I have tried to open it from the dock and the application folder but nothing happens.  Does anyone have any suggestions to get it to work?

    You don't need iDVD unless you are going to make DVDs. If you are just trying to share files, iDVD won't help you at all.
    What you want to do is in iMovie, choose File/Share/File, and export that way. It creates an .mp4 file that should be readable on Macs or Windows.
    You could also File/Share/YouTube if you don't mind posting them to YouTube, because of course YouTube videos are watchable by any Mac or Windows computer made in the last 10 years.

  • I moved my applications folder to the desktop, but modified the applications in my dock, and now i have too many copies of the applications folder and cant get rid of them without being unable to use the applications :(

    I moved my applications folder to the desktop when i first got my imac. now i want to get rid of it, but when i put it in the trash, it wont let me use the applications, even though they are in more than one folder. I am at a loss of what to do now cause i have two copies of everything. please help me figure this out.

    Marisalynne wrote:
    I have the applications folder in my harddrive and then the one that I moved to my desktop when I first got my computer.
    Where was the one that you moved to your desktop before you moved it to the desktop?
    I really don't understand what you're trying to say. If I have a folder in A, and I move it to B, then the folder will be in B. There is no duplication. I still have only one folder, only the location is different.
    Furthermore, your desktop is on your hard drive. Everything is on your hard drive.

  • Getting error while importing the application in Oracle Apex

    Hi,
    I am facing an issue while importing an application into my new Oracle Apex installation. Installation was successful with out any issue. I exported an application from my old Apex (version 3.0.0.00.20) and importing the same into new apex (version 3.0.1.00.08). I am getting the following error.
    ============================================================
    The requested URL /pls/apex/wwv_flow.accept was not found on this server.
    ============================================================
    When I click on import in Application Builder page and then browse the required file it gives the progress saying "Importing File" and after some time it displays the above error.
    I tried bouncing the application also and there is not error in alert log.
    Could any one please suggest, if there is some problem here. Or my approach is not correct.
    Thanks in advance.
    Regards,
    Advait Deo

    Osacar, I recommend that you try to import the application into your workspace on apex.oracle.com and see what happens. Also, refine the problem statement as much as you can, e.g., you get this error importing "the application" or when importing "any" application. How big is the file you're trying to import? Where did it come from? Can you upload images?
    Scott

  • Getting error while Importing the Application

    Hi,
    I am Getting Problem While Importing the Application
    We are moving the Application from Test enivorment to Production Environment, Both are Oracle 10g with HTTP server and Application Express 3.2.1.
    While Importing i am getting Error like.
    Error report:
    ORA-06550: line 3627, column 1:
    PLS-00123: program too large (Diana nodes)
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Please Help Me its Urgent

    Hi joel,
    Even tried for the Copy of the same application in the same Application but its giving the same error.
    and I tried with the SQL Developer It shows the error like
    Set Application ID...
    ...authorization schemes
    Rollback
    Error starting at line 200 in command:
    begin
    --application/shared_components/security/authorization/des_mstr_delete
    wwv_flow_api.create_security_scheme(
    p_id => 7573129300337441 + wwv_flow_api.g_id_offset
    in the line 200 the above code starts.
    at end This will be displayed
    Error report:
    ORA-06550: line 3652, column 13:
    PLS-00123: program too large (Diana nodes)
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • HT201210 I just updated my iTunes and now I get a message that the application has failed to start because MSVCR80.dll was not found.  What happened and how do I fix this?  I can't access any of my music now.

    I just updated my iTunes and now I get a message that the application has failed to start because MSVCR80.dll was not found.  What happened and how do I fix this?  I can't access any of my music now.

    Click here and follow the instructions. You may need to completely remove and reinstall iTunes and all related components, or run the process multiple times; this won't normally affect its library, but that should be backed up anyway.
    (99460)

Maybe you are looking for

  • How do i watch movies in itunes on a plane on my macbook

    Ive rented some movies from itunes and want to view them on my macbook pro on a plane trip. How do I play them without having an internet connection? On my ipad I go into videos, but I dont see that option on my macbook.

  • Adding back custom export and workflow presets back into Premiere Pro CC 2014

    I may have to delete preference files to stop PrPro CC 2014 from crashing when I try to start it [advice from fellow Adobe forum participants]. How do save my custom presets [H.264 protocols, workflows, etc] so I can add them back in [and how do I do

  • Problem when using BAPI to create return order

    Hi All, I need urgent Information. I am using BAPI_CUSTOMERRETURN_CREATE and BAPI_CUSTOMERRETURN_CHANGE to create and change quantity of return order. In both cases I am getting the result that quantity value is not getting updated. are these BAPIs a

  • Smartform printer issue LOCL/SAP PRINTER NAME

    Hi All, I have this smartform and driver program which i print through an output type from VF03. When i print with printer as LOCAL, it prints right. However when i use the same printer, this time specifiying the printer name the shadings and colors

  • Looking for online web editor to test ColdFusion tags

    Is there any place that I can test basic ColdFusion tags online?  I don't want to install coldfusion, while I want to test and learn some basics. I found a web editor at the following link. However, it doesn't provide adequate instructions to use it.