Re: Configuration params for a webapp - best practice?



Steve wrote:
I have a web app running in Tomcat and it can be configured with various
parameters.

In particular, one of the parameters is a file path that defines where
various work files, uploaded files and logs are written to.

I have created a config file in this folder for other parameters but
ultimately something needs to define this path.

My first attempt had the path hard-coded but now I realise that's probably
not right, since I have to install the web app on Windows and Unix machines.

So then I checked the 'os.name' system property but that only gave me a Unix
version and a Windows version of the path - still ultimately hard-coded.

Where is the best place to configure this path so it's not hard coded in the
web app and is easy to configure when the app is deployed?

readonly => put it in the war

single app Tomcat => JVM arg -Dmy.config=...

Java 1.5 => set a variable and get it in web app with System getenv

fallback => OS neutral absolute path like "/mycfg"

Arne

.



Relevant Pages

  • Configuration params for a webapp - best practice?
    ... I have created a config file in this folder for other parameters but ... since I have to install the web app on Windows and Unix machines. ...
    (comp.lang.java.programmer)
  • Re: Connecting VS.NET 2003 to IIS6/WSS
    ... successful at creating a web app with the source tree on the web server. ... >> I'm posting this question here, rather than in the programming group, ... >> web apps, web parts, etc. wants to find an IIS installation (with Windows ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Are there good reasons to upgrade to IIS 6.0?
    ... We already have Windows 2000 and IIS 5.0, which is why I put "upgrade" in my ... installed locally to a web app, though, so while it would technically be an ... >>also care about the benefits of using Windows Server ...
    (microsoft.public.inetserver.iis)
  • Re: Need to write web service
    ... I think for my web app I chose ASP.NET Web Site next ... type (ASP, Windows, Mobile Device, etc.). ... select Add Web Reference to add a webservice. ... ASP.Net Web Service - this will create your web service ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Moving from WinForm to WebForm
    ... We want it to be accessible through the web browser specifically ... Internet Explorer on Windows 2003 Server. ... build it using WinForm i.e. no browser just a windows application. ... If you believe you want a web app in the end, why would you get them to ...
    (microsoft.public.dotnet.languages.csharp)