The Artima Developer Community
Sponsored Link

Java Answers Forum
application-level variables in servlet on Domino

15 replies on 2 pages. Most recent reply: Oct 13, 2003 10:16 PM by Nandita

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 15 replies on 2 pages [ « | 1 2 ]
Nandita

Posts: 10
Nickname: nanditasr
Registered: Aug, 2003

Re: application-level variables in servlet on Domino Posted: Oct 13, 2003 10:16 PM
Reply to this message Reply
Advertisement
What I am now doing is creating a simple class, in which I set the values of these static variables, like this:

public class AppLevelInfo extends Object {

private static String sDBPath = "192.200.100.70/";

public static String getDBPath()
{
return sDBPath;
}
}//end of class

and then I retrieve the value each time in the servlet, when I need to, like this:
String sDatabasePath = AppLevelInfo.getDBPath();

I am rather new to Java, so I don't the know which would be better method. The above was the very first method I tried out, as mentioned in my first post.
What would be the pros and cons of using the above method as against the one suggested by Joe Parks?

Flat View: This topic has 15 replies on 2 pages [ « | 1  2 ]
Topic: How to create a frame that has a specific graphic interface? Previous Topic   Next Topic Topic: need to draw a city map to do Uniform search

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use