Configuring System property in weblogic

Hi All,

Sometime we need to configure few properties in server which we can easily read, without reading property files in java code/JSP code/Servlet.

Weblogic gives a very nice way to do that. Only thing we need to do is to configure the property with key value in server start options (i.e java options). We also called theses memory arguments. Just login to admin console, and go to server properties and add the below property.

-Dkey=MyValue

After setting the memory argument simply restart the server and access the property in your JSP/Java Code/Servlet

String keyValue=System.getProperty(“key”);
System.out.pritnln(“************** “+keyValue);

//output
// **************MyValue

Hope this helps.


Thanks
R Vashi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s