Where should I put the configuration file?

Hi
I'm developping a web application using IBM's websphere as my application server. My application reads configuration information from a properties file.
My question is: what's the right location to put the configuration file? Should I provide a fixed path, or should I just put in the webserver's execute directory?
Thanks in advance
Pedro

I'd consider what the configuration file is cheifly
tied to.
If there are only a small number of parameters then
put them into the web.xml as initial parameters and
access then via servlet cotext.
If they are tied to some class, then I'd put the
properties file next to the relevant class file and
use getClass().getResourceAsStream().
If they relate to the web-app as a whole, I'd put
them in the WEB-INF directory and access then using
getServletContext().getResourceAsStream("WEB-INF/xxx.p
roperties");The one thing you definitely shouldn't do is use an
absolute file path.Thanks for the reply.
Forgive my ignorance, but how can I access getServletContext from my web application?
Thanks again!

Similar Messages

  • In Which Directory Should I Put the Configuration File?

    I am using Servlets and JSPs. I have code like:
    private static final String OPTION_FILE_NAME = "mvnplugin_mvnforum_MVNForumConfig";
        static
           ResourceBundle res = ResourceBundle.getBundle(OPTION_FILE_NAME);
           MVNFORUM_HOME       = res.getString("MVNFORUM_HOME").trim();
           WEBMASTER_EMAIL     = res.getString("WEBMASTER_EMAIL").trim();
           LOGO_URL            = res.getString("LOGO_URL").trim();
           String supportedLocales = res.getString("SUPPORTED_LOCALES").trim();
           SUPPORTED_LOCALE_NAMES = StringUtil.getStringArray(supportedLocales, ";");
        }And "mvnplugin_mvnforum_MVNForumConfig.properties" is a configuration file. Please advise regarding the directory in which this properties file is supposed to be for my code to read it properly.

    Somewhere in your classpath, typically /WEB-INF/classes.

  • Where should I put the sevlet

    I just started to work with Tomcat and I compiled the helloWorld sevlet.
    It's said from a book that the sevlet should be placed in serlver_root/webapps/ROOT/WEB-INF/classes, however there isn't a "classes" folder in my WEB-INF folder. So I put the helloWorld sevlet in the WEB-INF folder.
    Then I type http://localhost:8080/servlet/helloworld in my browser, I get a message from the sever said "The requested resource (/servlet/HelloWorld) is not available".
    Could anybody tell me how can solve this prolbem, where should I put the sevelt?

    have ones more a look to your book - especially to information about the configuration file "web.xml" which also should be placed in the WEB-INF folder. This file defines which servlets should be found by the server and which request-URL should be mapped to this servlet.
    for examples concerning the web.xml file see those already defined in your server. copy one and edit it for your needs. if you really want to understand what else might be configured using web.xml see the DTD for this file - it's pretty good documented!
    hope it helps :)

  • Where should I store the collatoral files that are associated with photos stored in lightroom?

    Where should I store the collatoral files that are associated with photos stored in lightroom? Items such as pdf files, word documents, etc. How should I connect them to each other so I can find both the photo and the related data?

    Lightroom itself will not help you with pdf, word, etc.
    However, there is a plugin you can use called AnyFile which will allow you to manage these documents in Lightroom (by assigning keywords and other metadata) so that you can search for all documents (photos, pdf, word, music, powerpoint, etc.) with given metadata.
    Because you do this via metadata, it doesn't matter where you put these files. Put them anywhere you want.

  • Where should i put the DEFAULT&SMARTBAR

    Hello,
    where should i put the DEFAULT&SMARTBAR ? and the main Menu ?
    in order to be shown in each form..
    in using Forms 6i.
    Regards,
    Abdetu..

    Hello Gerd,
    Thanks for reply..
    put such things into *a reference form* what is meant by a reference form do u mean the main form?
    Create a property class (PC) for your FORM-MODULE-properties,
    put this PC into the reference form.
    Create there an object group (OG), put the PC into the OG and the inherit the OG to your local form.
    Automatically you have then the PC inherited too.i did all what u mentioned..
    Bbut the problem is that the DEFAULT&SMARTBAR
    can't be seen in allllllllllll my forms in the main menu inspite of i put it into the form module property ->in the intial menu property.
    Regards,
    Abdetu..

  • Where Should I put the time capsule?

    Where Should I put the time capsule?
    I'm using a wireless modem/router provided by the internet company, and both (the TC and the router) are located next to the pc, in the living room . Using this way, I don't have signal in my bedroom. Should I get a signal amplifier?
    Thanks!

    It would be better to use EOP adapters (homeplug is another name) or ethernet to locate the TC closer to your room.. you can use another apple router to extend the wireless if you need to.

  • Where should I store the rendered files?

    (My Color projects are in "Documents")
    Where should I store the rendered files?
    On my external HD with my FCP media? Or on my Hard Disk is fine ?
    Can I calculate that 1 Go of DV NTSC = 1 Go of rendered file in 10 bits?
    Many thanks

    this came up as a topic at a recent FCPUG seminar.
    Since the dawn of time, it is recommended practice to keep your media off the application drive.
    The more disks you have spinning, the better the chance that you will get the data throughput rates that will support the demands of your media. Whether that's a RAID or a JBOD, its up to you how you value your time and assets.
    I keep things as 'external' as possible, mostly because clients are anxious to get the material back, but I'd have to keep moving stuff around just to maintain the space. And I still have to get merciless with all the temporary FCP render stuff.
    jPo

  • For WebLogic 5.1, where should I put my class files for my JavaBeans?

    With JBuilder4, I have built an application with JSP and a few Java Beans (Those JavaBeans are instantiated in those JSP files). There are no EJBs. The package name is called 'onlinetrade'. I have tested the application on JBuilder's web server, it works pretty well.
    Now I am moving this application to WegLogic 5.1. I have encountered a problem with WebLogic 5.1
    and do not know where I should place my JavaBean class files --
    Originally, the JSP files for my application are in package path-- ..onlinetrade\jsp
    and the class files for my beans are in the package path -- ..onlinetrade\jsp\bean\*.class
    Now, with WebLogic 5.1,
    1) I have put my JSP files in
    C:\weblogic\myserver\public_html\onlinetrade\jsp
    2) I have created subdirectory and put my bean class files in
    C:\weblogic\myserver\classfiles\onlinetrade\jsp\bean
    When I started weblogic and the first page - login.jsp page can be up and accessed. But when I login and forward to another JSP page called 'controller.jsp', where a bean is instantiated, I got the following error
    Compilation of 'C:\weblogic\myserver\classfiles\jsp_servlet\_onlinetrade\_jsp\__controller.java' failed:
    C:\weblogic\myserver\classfiles\jsp_servlet\_onlinetrade\_jsp\__controller.java:210: cannot access jsp_servlet._onlinetrade._jsp.registerBean
    probably occurred due to an error in /onlinetrade/jsp/controller.jsp line 53:
    registerBean registerBeanInstance = new registerBean();
    I know the javac is working, and a java file is created upon the JSP page, but the problem is -- the bean class files cannot be found!!!
    Where should I create the package path and put my bean class file so that my JSP pages can pick them up?
    Any help is greatly appreciated!
    Thanks.
    --Tim

    I have mine in WEB-INF/classes

  • Where do I put the .jar file for the database connection?

    I am trying to connect to an Oracle 11g database. I see under the coldfusion settings summary that the java version is 1.7.0_55. So I downloaded the ojdbc7.jar file from Abode.com. Now the question is where do I put it so that coldfusion can access it?
    Of course I need to set up the database connection (which I still don't have the connection string for), but I still need to know where to put the ojdbc.jar file.
    Thanks.

    jasonwryan wrote:What does the man page say?
           The  program  has builtin defaults and temperature thresholds but users
           can   specify   their   own    settings    in    configuration    files
           /etc/default/i8kmon  and  ~/.i8kmon.   The daemon defines 4 states with
           different fan speeds ({0 0}, {1 0}, {1 1}, {2 2}) and  for  each  state
           are  defined  the temperature thresholds which cause the switching to a
           higher or lower  state.  Furthermore  each  state  can  have  different
           thresholds  for operation on ac power or battery.  For example the fol‐
           lowing configuration:
    I've put the following file in /etc/default/i8kmon:
    # Run as daemon, override with --daemon option
    set config(daemon) 0
    # Automatic fan control, override with --auto option
    set config(auto) 1
    # Report status on stdout, override with --verbose option
    set config(verbose) 1
    # Status check timeout (seconds), override with --timeout option
    set config(timeout) 1
    # Temperature thresholds: {fan_speeds low_ac high_ac low_batt high_batt}
    set config(0) {{-1 0} -1 50 -1 50
    set config(1) {{-1 1} 50 70 50 70}
    set config(3) {{-1 2} 70 128 70 128}
    But it doesn't seem to do anything. I'm running a Dell Inspiron 3521 with no dedicated GPU, so it only has one fan. I was somehow able to get i8kmon to work in Ubuntu by putting this config in /etc/i8kmon, but can't get it to work in Arch. Putting it in /etc/i8kmon and /etc/default/i8kmon doesn't do anything.

  • Wher should I put the sIM card

    I do not find where should I put my SIM card

    There is only one place for it to be effective. I guess you didn't read the little leaflet that pointed you to this: 
    http://manuals.info.apple.com/en_US/iPhone_iOS4_User_Guide.pdf

  • Where should I put the DB?

    I have been working on a local instance of RoboHelp - copying
    files to my laptop to work on them, then uploading to the server
    for someone else to download and work with. Now finally have a
    server environmen set up and was able to successfully connect via
    robosource control...wondering recommendations for where the actual
    project/dabase should be? Should it be on the same server as
    robosource control? Then as a user we would connect, then open the
    file from there, correct.
    I think it's already been said, but support/documentation on
    this end of the tool is pretty - shall we say - limited.
    thx.

    Hi kerstent and welcome to our community
    Basically, with source control systems, here is how it works.
    You install source control databases on a server. Then you add
    source files. Each PC that is part of the mix then connects to the
    database and manipulates the files. Part of the setup for using
    source control involves configuring a "Working Folder". Normally,
    this working folder is where you actually make changes to the
    files. It is also normally on your local PC. If all files are
    checked into source control, you may have duplicate copies on your
    PC. But all the files on your PC are in a read only status. Then
    when you attempt to check them out of source control, a couple of
    things happens. The server files are compared against your working
    copy files. If the server files are newer (meaning another author
    modified them) they are copied to your PC, checked out to you and
    the status is changed from read only to read/write.
    Hopefully that didn't only serve to muddy waters... Rick

  • Where should I store the image file?

    I registered a schema, created a table, then inserted a XML file which contains following lines
    <material>
    <matimage imagtype="image/gif" uri="image2.gif">
    </matimage>
    </material>
    My question is where should I store this image2.gif so it can be displayed when my application retrieve this XML file?
    Thanks,

    In the XML DB repository.. See dbms_xdb.createResource().

  • Where should I put the conc mgr mid-tier or backend ?

    Hello All,
    Is there any advantage to putting the conc mgrs on the mid-tier as opposed to the database tier other than saving some memory usage on the database tier ? All the work would be carried out on the database tier wouldn't it ?
    thanks
    Dave

    Hi,
    What I was really looking for was, if there is some particular advantage I could gain from putting the mgrs on the mid-tier ? The main advatange is having all the application tier files on one node which make it easier to maintain than having the application tier nodes split on both tiers. In this case, you will have to patch the application only once (not on every node where APPL_TOP is presented).
    If I put the conc mgrs on the apps tier, this means that I would never need to apply patches to the backend, given that all the apps software is on the apps tier and the database software is on the database tier. If I have 2 apps tiers I could use pcp ? But since all the work is carried out on the db tier this (pcp) would be a pointless exercise right ? You cannot use PCP if you place all the application tier files on one node. If you want to have PCP, you will need to have multiple application tier nodes.
    Thanks,
    Hussein

  • Where should I save the playlists file

    In what specific file on my computer should i save my iTunes personal playlists files

    If you mean Playlists created in your iTunes Library, iTunes does all that for you. You don't have to "save" them anywhere. As you edit them, iTunes "saves" them and they should be in the same place when you next open iTunes.

  • Where should i put the file adf-config.xml ?

    hi,
    I want to enable adf authorization,according to B25947(developer guide for 4gl/form developer),this file should put to <application_ name>/.adf/META-INF
    Is it correct?I'm feel odd. Another thing is :why container binding authorization user/role come from system-jazn-data.xml?
    thanks everyone advance
    lixinzhu
    2007/4/25

    Hi,
    yes, .adf\META-INF is located in the root workspac directory. It is created automatically if you se JDeveloper 10.1.3.2, which has an ADF Security wizard to automate the setup.
    The system-jazn-data.xml usage is a requirement coming from OC4J and has to do with ADF Security using JAAS for authorization. This is subject tochange in a future version in which JAAS definitions will be possible on an application scope (jazn-data.xml) as well
    Frank

Maybe you are looking for

  • Use of templates in site

    Hi there, is it OK to design and use a template for all pages in a site except the index page - can I just do this as a stand alone then link to the templated pages - or will this cause me problems? Thanks (having a disaster with a site in some IE8 P

  • Wrong sequencing with Oracle db using sequence table?

    Hi, we have a strange problem resulting in primary key violations in a table which is using a sequence (no native sequencing, but a sequence table). We use Oracle 9.2.0.x We have a table which is mapped to a Java type which has two derived types, i.

  • TS4108 I deleted a calender from Calender and lost everything and can't get back? How can I recover?

    I was trying to link the calender with my dad when i deleted the wrong one and lost everything and desperately need to recover! Is there anyway I can recover the calender without losing data on my phone?

  • Quicktime error -50 with QT 7.0.4 and OS 10.4.5

    Since I upgraded to 10.4.5, Quicktime 7.0.4 fails to export some files to H264. I copied the same files on a another machine running 10.4.4 with Quicktime 10.4.1 and I had no problem.

  • 5.1 mix AND Stereo mix on dvd

    I have a project that has a 5.1 mix (i've already made an ac3 file through compressor) and also has a 2 channel stereo mix. I'd like them both on the dvd so if someone doesn't have 5.1, they can watch in stereo. Is there anyway to have it automatical