Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

environment variable

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I am not sure this is right forum for the question.

I have a scenario wherein the web application deployed in Weblogic app server produces a pdf file and stores it on the file system. We want the location on the file system for this file to be configurable and not hard-coded as part of the code.

One option was to configure an environment variable in Weblogic and use the environment variable in the code something like jndi datasource name used for dynamically configured database connections.

I am looking at the Weblogic server but was not able to find an option to create such an environment variable within Weblogic whose name can be used within the code and value will be the pdf directory location.

Let me know.

Regards,
 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Create a property file, which contains the location where you want PDF files to reside.

2. The property file will reside in the file system.

3. The location of the property file can be passed to WebLogic using -D option. For example; -DPropFile=/usr/local/bea/propertyFile.properties.

4. Another option would be to load the property file as the resource bundle. In this case you dont have to use -D option.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic