How to find the root document of my web application, if it is in WAR file ?

Hi,
I want the root document of my web application. I my EAR file, i have only one WAR file. In my WAR file the following are the folders:-
enterprise/..
properties/sql/..
locale/..
WEB-INF/..
Once i get the 'real path' or 'root document', I will use that in my application in no.of times. Path(root document) is used in the following way in my application:-
File emailTemplatesFolder = new File( path + "/enterprise/"+ enterpriseCode+"/EmailTemplates");
If i use getRealPath() method, it works fine, in use Oracle9ias, because, EAR file will be extracted. Where as in Weblogic 6.1, EAR file willn't be extracted, so that getRealPath() is giving 'null', that is reason why i am seeking for alternative.
Thanks in Advance
Srinivas

Yes, that is the corrected behaviour.
What you need to do is to get the ServletContext, and then load the files as resources.
Here is how to load a properties file in the init() servlet method, which has access to the ServletConfig object that can give u the ServletContext.
String classesDir = "/WEB-INF/classes";
ServletContext sc = config.getServletContext();
InputStram is = sc.getResourceAsStream(classesDir+"default.properties");
props.load(is);
Hope it helps,
Liviu

Similar Messages

  • How to find the root document in my application, if application is deployed as  EAR file ??

              Hi,
              I want the real path, i mean root document.
              I my EAR file, i have only one WAR file. In my WAR file the following are the
              folders:-
              enterprise/..
              properties/sql/..
              locale/..
              WEB-INF/..
              Once i get the 'real path' or 'root document', I will use that in application
              in no.of times. Path is used in the following way in our application:-
              File emailTemplatesFolder = new File( path + "/enterprise/"+ enterpriseCode+"/EmailTemplates");
              If i use getRealPath() method, it works fine, in use Oracle9ias, because, EAR
              file will be extracted. Where as in Weblogic 6.1, EAR file willn't be extracted,
              so that getRealPath() is giving 'null', that is reason why i am seeking for alternative.
              Thanks in Advance
              Srinivas
              

    Yes, that is the corrected behaviour.
    What you need to do is to get the ServletContext, and then load the files as resources.
    Here is how to load a properties file in the init() servlet method, which has access to the ServletConfig object that can give u the ServletContext.
    String classesDir = "/WEB-INF/classes";
    ServletContext sc = config.getServletContext();
    InputStram is = sc.getResourceAsStream(classesDir+"default.properties");
    props.load(is);
    Hope it helps,
    Liviu

  • How to find the accounting document

    Dear all,
    Can somebody tell me how to find the accounting document from the MIGO transaction. I entered a goods delivery into the system. An accounting document should already be created.
    Best Regards
    Jerome

    Hi Jerome
    Go to that that material document (which was created through migo transcation)and click on Doc info header. There you can find FI documents. It will give the accounting documents (if any that has been created).
    Hope this helps.
    regards
    Anand.c

  • How to find out Db name of perticular web application in sharepoint 2010

    how to find out Db name of perticular web application in sharepoint 2010 to take a backup from sql

    1.  Open the SharePoint 2010 Central Admin application.
    2.  On the SharePoint central administration website, click Application Management.
    3.  In the Databases section, click Manage Content Databases.
    4.  On the Manage Content Databases page, select a web application by clicking the Web Applications drop-down list and choosing a web application.
    5.  Can notice the  available database names for the webapplication. ******************************************************************************************
    Please remember to mark your question as answered &Vote helpful, if this solves/helps your problem
    s p kumar

  • How to find the Internal Document Structure Number STLNR from the DIR Key

    Hello:
    Our requirement: When a user moves the Header DIR of a Document BOM to Released Status, we need to check if all the BOM Items in this Document BOM have also been released (in Status Released). If not, we need to give the user an error message informing them which component DIRs need to be released before the system will allow them to release the Header DIR. We can do this by entering the DIR Key of the Header DIR and find out the Internal Document Structure Number (Document BOM Number = STLNR for BOM Category Document Structure STLTY = D) from the available input of the DIR Key DOKARDOKNRDOKTL+DOKVR. Then we need to use the value of STLNR in Table STPO to find the Document BOM Items and check the status of each BOM Item DIR.
    If Table STKO had DIR Key as an input we would have our solution, but alas it does not. Can anyone point us in the right direction by suggesting how to get to STLNR from the DIR Key? Your help would be much appreciated!
    Niraj Pant

    Hi Niraj,
    the STLNR should be contained in structure rc29k. You can also use the DMS BAPI DOCUMENT_GETDETAIL2 with parameter GetStructure or DOCUMENT_GETSTRUCTURE. With these BAPIs you should be able to determine the document structure to an existing document info record. For further information on the mentioned BAPIs please see SAP note <a href="https://service.sap.com/sap/support/notes/766277">766277</a>  which contains a complete documentation on all existing DMS BAPIs.
    Best regards,
    Christoph
    P.S.: Please reward points if this information was usefull.

  • How to find the roots of other system in the network

    With out using RMI can we find the other system drive information(the roots available) from local(my) system..?

    public class roots{
    public static void main(String args[]) throws Exception
    System.out.println("The Drives are:");
    File[] roots = File.listRoots ();
         for (int i = 0; i < roots.length; i ++) {
         System.out.println (roots);
    This displaying the local system roots. Here how can i implement remote-filesystem protocol such as SMB or NFS .?
    I am not aware of this implementation as i am beginner ...
    kindly help me

  • How to find the Inventory document no based PO number

    I need to identify the PO no. for the inventory document nos which were generated thru MM.
    Any report or transaction code to view the PO number
    Regards
    KRISH

    Hi
    You need to check Mb51 report. You may not see Purchase order field in selection screen of Mb51. But in customizing you can bring it. see the belwo config
    spro>Materials management>inventory management>Reporting->define field selection for material document list
    here for program RM07DOCS(report mb51) add MSEG-EBELN and MSEG-EBELP. and tick output and selection.
    Now MB51 is ready for PO input. In desplay you get all transactions after PO in that.
    If your problem is not solved write to me
    regards
    Antony

  • How to find the sessions connected to oracle through application server?

    Hi all,
    i want to restrict my application server users from the deletion of the data in my database.
    for this i was try to find out the application name from v$session but it is showing some application names and some blanks. i need to find out the application server name, so that i can restrict the users in product user profile.
    is there any view to find the sessions and applications which are connected to oracle database?
    Thanks,
    Sandeep

    hi pavan,
    Even whne the privileges are revoked, the java application(users) can able to delete data in the database schema through the java application.
    please suggest me on this?
    --sandeep                                                                                                                                                                                                                                                                                                                                                                                                       

  • Please help, how to guide the user to deploy a web application easily.

    hello,
    i have created an application which creates a new web application every time it is run. now i am writing the documentation of it and dont know which web server the client may have so i have to write / show to the user general steps that he should follow to deploy the web application after it has been created.
    i have written that the user should deploy the web app by making the following entry into the server.xml file (for tomcat)
    <Context path="/webappname" docBase="webapppath"></Context>
    it is not compulsary that the user should place the web application in the webapps directory of the server hence the above webapppath is used.
    now i want to indicate to him where and before / after which tag and under which host name etc the above line should be added in a manner that he is able to do it properly.
    please anyone can help me how to do it.

    i would like to know if there is any way without Java web start.
    it has to be set manually.
    i.e every user should make this entry in the server.xml so that the context is set.

  • How to find the attached docuements in po

    hi gurus,
    i have a typical issue, we r using ecc6.0.
    whenwe attach docuement to a sales docuement in sales order it has to be view in the production order.
    but we r not able to c the attachemnt in the production order pls help me in this.
    very urgent

    Hey,
    Plz ckeck out the schedule line category.whether is indicator tick on Requirement, Product allocation, availabilty check,assembly etc or not.
    If not plz do that and also check whether u have created Copy control setting or not.
    plz let me know.
    thanks
    mk

  • How to find the current document No in VBAK table?

    Hi
    I want to fill the set up tables from 2LIS_11_VAITM using Number ranges . Iknow initial Sales Order number but I want to know the current number so that I can set up a range..
    Thanks,
    Suresh

    Look in VBAK on the day you want to load on.  Grab the the highest number right before you load the setup tables.

  • How to find the size (and sizelimit) BPS web interface

    Hello.
    We have build an application with the SEM-BPS webinterface builder.
    In the past we had problems with the size off this application. After we had added some new tabs in the application the size limit had been exceeded and the web inteface could not been activated. So we had to remove the new tabs into a new webinterface.
    Now we have to add again some new tabs into the webinterface application. That brings up some questions.
    Wat is the sizelimit of the webinterface application?
    Can we change this limit?
    How can we know the size off the current application?
    How can we find out the size of a separate tab in the webinterface? (So that we can make a prediction of the size which will be added to the web interface)?
    Thanks and regards,
    Eldo.

    Trevor.Dennis wrote:
    John, are there already differences?  I thought 13.1 was mainly about retina display support, but I guess there would also be other fixes released while they were at it.
    Yes, definitely already differences. I sympathize with Photoshop instructors (online and offline).
    The headline change was Retina support but that was also made available to non-Cloud versions.
    Other Cloud-only changes in 13.1 are listed here
    http://helpx.adobe.com/photoshop/using/whats-new.html
    http://psd.tutsplus.com/articles/news/cs6_1/
    Non-Cloud CS6 users have been very vocal and disgruntled about some of these changes.

  • How to include the OBI reports in other web applications such as flex.

    I am currently working in Flex and java. I learnt the basics of OBI and constructed some reports. Now i want to include these reports in my Flex application as a part of dashboard. I want to know the way of doing it....

    Post Author: Argan
    CA Forum: .NET
    http://support.businessobjects.com/communityCS/FilesAndUpdates/vbnet_web_samples.exe.asp

  • How to find the XML file size in the scenarios?

    Hi All,
    Recently i have attended an interview at a MNC.
    They asked some realtime questions like
    1.how to find the XML document size in a File-File scenario?
    2.What is mass-assignment replication etc.....
    Can anybody tell me the solution for these.
    Best regards
    Hari prasad

    If the input is a flat file, there is no exact way to calculate the size of the generated XML file, since it depends on many factors (number of fields in the recordsets, size of the name of the fields, number of records, etc).
    As a rule of thumb, generally ppl use XML file size = 2 x Flat file size, in order to do sizing calculations etc. But again, that is just an estimation, not a precise calculation.
    Regards,
    Henrique.

  • To cancel logs in SM35 and find the root cause

    Hi,
    The role "PM****" is creating lot of sessions with the same session name and each session has hundreds of logs everyday in SM35. The logs is all about scheduling maintenance plans. There are hundreds of maintenance plans scheduling logs everyday. Can anyone help me how to find the root cause for this problem and stop the logs being generated in SM35?

    Hi,
    When you schedule RISTRA20 (transaction IP30) there are options for 'log control', check these and decide what level of logging you require.
    -Paul

Maybe you are looking for