JSP and location of .properties file

Hi,
I have a directory in my C:\apache\tomcat\webapps directory entitled "ignmDBInt".
I have a jsp file in this directory that works successfully. I would like it to open a .properties file. However, it cannot be found.
Where should this .properties file be located?
My code to access the .properties file is below.
//opent the config file and get the field names
ResourceBundle myResourceBundle = ResourceBundle.getBundle("Properties");       
String fieldNames[] = myResourceBundle.getString("fieldNamesDelimited").split(",");
String properNames[] = myResourceBundle.getString("properNamesDelimited").split(",");

That last reply fixed it. Thanks!
I didn't realize you had to set JSPs up like servlets.

Similar Messages

  • Diappearing photos replaced by an exclamation point within a triangle.  Prior to loading Lion I could put the image number in finder and locate the original file for that photo.  How do I restore photos now?

    I had problems with photos disappearing and being replaced by an exclamation point within a triangle.  I can see the photo in the thumbnail summary but when you click on it, the screen goes black and the exclamation point within a triangle appears along with the info on the original image number (i.e., img_1120.jpg). Prior to loading Lion, I could go to Finder, enter the image number and locate the original file for that photo.  I could then restore it for editing, copying into Print Shop directly, etc.   That no longer works after installing Lion.   How do I restore photos now?  I have 100s of photos that I have been going back to the original files and restoring and I am frantic that I will no longer be able to get to the original files.  Please help!  Thanks

    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    What version of iPhoto? Assuming 09 or later:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Locating a properties file

    Hey,
    My application makes use of a properties file which it needs for some connection settings. Currently the properties file is in the same directory as the .jar (.exe) so everything works fine. but i at some point id want the .exe to be on the desktop but the file located elsewhere. so i thought .. y not use JFileChooser, and i did, and everything worked fine. noww.. the problem is ... i only want the open file dialog to show when it cant find the file. so .. when the filechooser is used.. i need a way to save the path (i can get the path using file.getPath() ) but how/where do i save this path? ( cant save it in the properties file lol). whats the proper way to handle this? Thanks,
    bpfl

    Do you hava example on how i can use this?
    i did find this...
    package com.acme.widget;
    import  java.util.prefs.*;
    public class Gadget {
        // Preference keys for this package
        private static final String NUM_ROWS = "num_rows";
        private static final String NUM_COLS = "num_cols";
        void foo() {
            Preferences prefs = Preferences.userNodeForPackage(this);
            int numRows = prefs.getInt(NUM_ROWS, 40);
            int numCols = prefs.getInt(NUM_COLS, 80);
    }so thas setting the number of rows and number of columns .. right? this is how i set the preferences for a particular user. i want to be able to set them one time and then everything the program is launched, it should use those preferences set the very fist time the program runs, i do have connection settings page in which the user can change the settings. How do i get preferences?

  • How can i locate the properties files within a ejb container?

    when i develop servlet+javabean structure application,in order to imploement decoupling,i
    would like to write the config information in the properties files(key-value pair),in
    servlet,i use "getResourceAsStream(String relativePath)" method to retrieve the
    configuration information from the properties files(i even write the SQL clause
    in the files),it alwsys works well.
    now,i want to implement such function within the ejb container,that is to read
    a properties file from session bean,but i don't know how can i locate the file
    within the ejb container by using relative path,i wonder if there is the same
    method within ejb container as "getResourceAsStream(.......)" method within servlet
    container?
    thanks for any helps!
    the code snippet is appreciated!

    In general, you should look at using environment entries (variables) in the
    deployment descriptors (both the war and EJB jar rather than properties
    files for configuring J2EE applications. The reasons for this are many:
    1. This is the official way to do it according to the spec. Properties
    files are the J2SE way of doing things
    2. As you note, that it's not obvious how you would (legally) read a
    properties file inside an EJB.
    3. It's consistent between the web and EJB part of your code
    4. the weblogic console and tools have good capabilities to edit these
    fields.
    Kent
    "zhebincong" <[email protected]> wrote in message
    news:[email protected]..
    >
    when i develop servlet+javabean structure application,in order toimploement decoupling,i
    would like to write the config information in the propertiesfiles(key-value pair),in
    servlet,i use "getResourceAsStream(String relativePath)" method toretrieve the
    configuration information from the properties files(i even write the SQLclause
    in the files),it alwsys works well.
    now,i want to implement such function within the ejb container,that is toread
    a properties file from session bean,but i don't know how can i locate thefile
    within the ejb container by using relative path,i wonder if there is thesame
    method within ejb container as "getResourceAsStream(.......)" methodwithin servlet
    container?
    thanks for any helps!
    the code snippet is appreciated!

  • Output of cmd in command prompt as key and vaule in properties file

    hi,
    i want to get the value of any command which i run using cmd in a properties file as a key and value rather then getting it in text file
    for example - hostname>output.txt   [not good], i want it to be like hostname>output.properties with a key and its value as output.
    command - `hostname`
    output - userpc
    but i want the same output in a properties file like
    xyzkey=userpc   in sample.properties file.
    it would be a great help.
    thanks
    sid

    I am sorry to say that it is not possible to understand what you are asking.
    Please post a copy of your script with any error messages.
    ¯\_(ツ)_/¯

  • How can I transfer dates and locations from excel file to iCal?

    I received an Excel file with dates and locations to visit for 45 days. Is there a way to transfer over to iCAL and then to iPhone?

    how to input all those addresses into my Garmin as well.
    I can't help you with that one.
    Could have I also input somehow from excel to entourage and then ical??
    I don't think Entourage has the data detectors feature.
    AK

  • DVD for Movie and location for picture files

    In iDVD can I play a movie of some pictures and also use the dvd for a location of the pictures used soe a person can watch the movie or go to a folder from the menu and see the pictures or drag the pictures to their computer?

    Are you referring to the Dvd-Rom section of the dvd? Yes you can add any file you wish to this section but it wont be playable by most set top dvd players. But you can use a computer to drag and drop the data to a different mac or pc.
    Adding files to the DVD-ROM portion of a disc
    You can let viewers copy files directly from your DVD by adding the files to the DVD-ROM portion of the disc. These files are burned onto the DVD and are accessible when the disc is viewed on either a Windows PC or a Macintosh computer, but not a DVD player.
    You can add any kind of file to the disc. For example, if your disc contains a slideshow, you can add the image files to the DVD-ROM portion of the disc so viewers can download them to their own computers and print them. You can also add a file containing your movie production notes and other “extras.”
    To manually add files to the DVD-ROM part of your disc:
    Choose Advanced > Edit DVD-ROM Contents.
    The DVD-ROM Contents window opens.
    Click Add Files, or click New Folder first if you want to create a folder to put the files in.
    Browse to select your files or folders, then click Open to add them to the disc.
    You can also drag files directly to the DVD-ROM Contents window. When you are done, just close the window.
    When you add a file to the DVD-ROM portion of your disc, before you burn the disc the project contains just a reference to the location of the file on your hard disk, not the actual file. So if you delete a file from your computer or move it from its location after adding it to the DVD-ROM contents, you get a “File not found” message when you try to burn your disc. You can either remove these missing files from the DVD-ROM contents or find them on your computer and put them back in the original location so iDVD can access them.
    As you add files to the DVD-ROM contents, be sure to check the DVD Capacity meter in the Project Info window to find out how many gigabytes of disc space are being used. The Capacity meter shows the disc space taken up by the video portion of the disc as well as the DVD-ROM portion.
    NOTE: It is not recommended that you use this feature as a way to create regular system backups on DVD. If you want to create DVD backups of files on your computer’s hard disk, use the Burn Disc feature in the Finder.
    When you add RAW images to a slideshow from iPhoto or from elsewhere on your computer, the files appear as JPEG images in your slideshow. If, in iDVD preferences, you choose to add photos from the slideshow to the DVD-ROM portion of the disc (so that viewers can download them to their computers), the RAW files are added, not JPEGs.
    Hope this helps but if not just come on back.
    Message was edited by: SDMacuser

  • How to read multiple files at multiple locations using properties file

    hi all ,
    in my code i take configuration input from a properties file ,it was really easy but what if there are multiple files ? how can i take configuration input (file path etc) from properties file in that case ? any suggestion ?

    thanks :) ..i am doing like this :
    String fName[]=new String[10];
              String choice[]=new String[10];
              String Delim[]=new String[10];
              ResourceBundle a = ResourceBundle.getBundle("input");
              String n=a.getString("NOF");
              try
                   for(int i=0;i<Integer.parseInt(n);i++)
                        fName=a.getString("PATH"+(i+1));
                        choice[i]=a.getString("HEADER"+(i+1));
                        Delim[i]=a.getString("DELIMITER"+(i+1));
                        putData(fName[i],choice[i],Delim[i]);//to put data in database
              catch (NumberFormatException e)
                   System.out.println("Number of files are invalid");
    hope this method would be fine ....again thanks for the advice :) :)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Rename files and locations of the file

    Hi, I have 2 questions:
    1) when I modify information's of a mp3 file (album, title, artist) in the library is it possible to modify also the name of the file?
    2) Is it possible to show the location of the mp3 file directly in the library view or i need to do always right clik - information's to found it
    thank you

    Francois Gualtieri,
    Yes you can rename the song in iTunes:
    In the main window, when you have Music or Library (pre iTunes 7.x.x) selected in source list, try to slowly single left click to select a song, then single left click to highlight its name, then rename.
    And to "show the location of the mp3 file directly in the library view", right click on a song, choose "Show in Windows Explorer" option. The resulting Explore window will indicate files location in the Address bar.
    Hope this helps,
    Generik

  • Moving a functional jsp and jar file to new directory breaks import?

    Simply put - how can I "move" or "copy" a functional JSP directory from the root of my site to a subdirectory
    of the same site and have it continue to work?
    here are the details:
    I have a site where the functional JSP content resides like so ...
    c:\site\itworkshere\thetestfile.jsp
    c:\site\itworkshere\WEB-INF\web.xml
    c:\site\itworkshere\lib\thejarfile.jar
    c:\site\itworkshere\classes\props.properties
    but when I copy the"itworkshere" directory to c:\site\newdirectory\itworkshere
    and try to load thetestfile.jsp page in my browser, I get ...
    thetestfile$jsp.java:6: Package com.corporatename.module.io not found in import.
    I know that the module.io classes are in thejarfile.jar, but for some reason, now that I've put the files
    in a new directory, the import is failing (simple import directive in thetestfile.jsp) And - yes - the .jar
    file is there in the new subdirectory.
    I am a newbie with jsp and just need to copy the files to new location and have them continue to work.
    Do I have to recompile the .jar with some sort of adjustments? I poked around and I don't see any assumptions about the directory structure in the build. The behavior leads me to believe that the build is assuming something
    about its location in the directory tree.
    Hope this question is clear and I appreciate any direction you can provide to steer me where to look/modify
    the necessary changes so I can move the .jsp's and .jar and not break them.

    Thanks for the suggestions and insights. I have made some progress.
    a context path of "/newdirectory/itworkshere" and a docBase of "./newdirectory/itworkshere" has resolved
    the .jsp include problem.
    However this seems a bit counter-intuitive to me considering that the default root context which is "" stands
    at the appBase which in my case is C:\Site. Since the default does not explicitly refer to the "itworkshere" directory,
    I'd expect that the newly added Context element would not have to either ---- BUT --- it does require that I include "itworkshere" in the context path and docBase (where I would expect ./newdirectory would have been sufficient since the default works that way) ... am I missing something?
    Now I havethe next odd behavior - the Servlet which resides in "itworkshere\WEB-INF\lib" is not loading when I put the appropriate URL in --> /newdirectory/itworkshere/DataCrunchingServlet
    I checked the web.xml file and it has the appropriate servlet-name and url-pattern (relative references)
    Furthermore I did a test where I simply rename the original working instance directory and again --- the URL is failing to find the servlet!!! (and yes I stopped/started Tomcat) It is as if the servlet can only be found in the originally installed scenario.
    I am extremely puzzled that the behaviors seem to indicate an assumption about the path structure, but the web.xml file is set up correctly.
    Help help!!! and Thank you.l

  • Can't locate .properties file on Visual Admin

    Hello,
    I have created an RID.properties file inside a DynPro application under src/packages/... and I am able to load it and get it's attributes from the DynPro code.
    So far so good...
    As far as I know this properties file can be viewd and modifed on the Visual Admin under:
    Configuration Adapter -> webdynpro...
    I've browsed all the folders at this location and couldn't locate my .properties file. So where is it...?
    Roy

    i think you only want to access and maintain the properties on server side...
    ok, check out
    http://help.sap.com/saphelp_nw04/helpdata/en/b8/aa343e32ff1033e10000000a114084/content.htm
    for an example how to access the properties from your wdp app.
    i suggest loading all props into a specific context node and corresponding attributes. perhaps there are better ways.
    Now sth. uncomfortable:
    Be careful when you redeploy your app. All properties are overwritten with the ones you defined locally.
    you also cant delete the config on local side, it would be deleted on server, too. (at least i think so)

  • Jar file and properties file

    Hi all,
    I have a jar file packaged as com.company.java located in $JAVA_HOME/jre/lib/ext. It will read a properties file when it is initialized. As I know, properties file needed to put under $CLASS_PATH. So I put it under $JAVA_HOME/jre/lib/ext also. However, the JAR file failed to load the properties file.
    Below is a part that in JAR file for getting properties file.
    ResourceBundle rb = ResourceBundle.getBundle("abc",Locale.getDefault());
    s=rb.getString("key1");
    } catch (MissingResourceException e) {
    s=null;
    e.printStackTrace();
    Do I put the properties file in wrong location?
    Where do I put it to make it work?
    Rgds,
    unplug

    by default you have 3 class loaders that load classes as well as read resources:
    The bootstrap classloader (for the core classes)
    The extension class loader (finds anything in any .JAR placed in $JAVA_HOME/jre/lib/ext/ [which is the home directory for "extension modules"])
    And the system class loader (looks along the classpath, finds files inside JARs [listed in the classpath] and in normal subdirectory structures [of base directories listed in the classpath] that mirror the hierarchy of Java packages)
    Any of these is supposed to consult the previous loader on the above list first, and try a lookup on its own only if the previous loaders did not find a class.
    ResourceBundle.getBundle(String, Locale) uses the classloader of its caller to look for the properties. If your method calling getBundle() was called from another method inside your extension module it will first consult the extension classloader (which first consults the bootstrap classloader) and will not be able to use the system classloader. So you can place anything in the classpath but it won't help. And the extension class loader can only look into JARs, not plain package directories.
    If the getBundle() method were called directly from the application code, however, it will use the system class loader to locate the properties file.
    There is a method ResourceBundle.getBundle(String, Locale, ClassLoader) where you can pass in e.g. the system class loader if you know how to get it, so this might help. The application code would determine its own class loader and pass it to the method of your your extension module.
    But I am not sure that you should place the properties file in $JAVA_HOME/jre/lib/ext/ since this is intended for Java extensions rather than normal user code, it normally does not show up on the classpath. Also, if you place it along the classpath, you have to pass in the classloader to be used since your code was loaded by the extension classloader and has no immediate knowledge of the system classloader.
    But perhaps it would be wiser to load your resource bundle reader in the system classloader, like any other application code: Remember that classes loaded by the extension classloader have higher security privileges than normal application code (the security policy file that you can edit refers to application code!) and it is questionable whether a resource bundle reader needs that privileges. If it does not, you might just place it in the classpath rather than the extension directory. Then it is quite natural that a properties file will also be found on the classpath.

  • File to File and then Call ABAP Program and pass file name and location

    Hi
    I am new to PI and am working on the following requirement and some guidance would help:
    A file is picked up from a third party server using FTP and is put in an SAP server in a specific location. After I have put in the file successfully, I need to call an ABAP program and provide the name and location of the file for further processing by the ABAP program.
    Although I am familiar with File to File, how can I add in the ABAP call with the filename and location? I do not want to pass any other information to the ABAP program.
    Thanks for your help.
    Manoj

    I think I get what you're saying. This additional file would have the file and the path in it's content. I would then use this as a source (FCC?) for Mapping with the RFC. Right?
    Exactly and yes, FCC would be helpful
    Would you have a sample OS script to do the above?
    Actually it depends on the operating system on which your PI system is standing. For instance for Windows, you might try with the following as a start point (but I was not able to test it, so I can't guarantee it will do the job):
    cmd.exe /C "%f %F > C:\target_directory\%DATE%_%TIME%.txt"
    In case you needed more, try googling on "windows batch script" or similar.
    Hope this helps,
    Greg

  • How can i remove a key and its value from properties file

    hi all,
    i want remove a particular key and associated value from the
    properties file. is their any standard way of doing?
    thanks inadvance
    daya

    hi,
    thanks
    i am able to remove the key,
    one more question how can avoid storing date and time
    in properties file.
    thanks
    daya

  • Using jrun and properties files

    For some reason my while deploying, the jsp cannot find the .properties file. I've tried putting it in almost every single directory on the server. Can anyone help???
    Thanks

    The .properties files must be in the classpath that JRun is using. There should be a <something>\classes directory in your CLASSPATH that JRun's using, try putting it in there.
    Take Care,
    Rob
    null

Maybe you are looking for

  • Doom 3 universal patch on MBP

    after i got my MBP i installed doom 3. to my stupidity, i opened to play it and it was laggy, forgetting it needed a universal patch. i went and downloaded the patch and when i open it to install it everything locks up except the mouse. meaning if i

  • Itunes keeps on saying itunes has stopped working

    Most recently, I updated my iPhone 5 to ios 7.1.2, however instead of updating it went to the recovery thing. So I went to itunes to recover my iPhone but it keeps on saying Itunes has stopped working. Anyone one know how to fix? btw i'm on windows 8

  • DataGrid scrollToIndex problem

    Hello When use dataGrid.scrollToIndex(dataGrid.selectedIndex); it scrolls, but if the selected is the last row, it displays not full How to fix to make it to display the whole last row?

  • Seeded Reports within Oracle BPA Suite...

    Folks, Would you be able to point me towards any Demo Script that I could follow against our Demo Databases to test all the seeded reports within BPA? I was looking to run these reports against any of these Demo Database: "Demo70" or "United Motors G

  • Please help me , I am having java.security.AccessControlException

    Hi, Let me tell you may problem, I have an application with its jar file build inside for eg in E:\Projects folder with the name MyApplication, also I have build this application and its jar file whose name is MyApplication.jar is inside dist folder.