Tomcat 4.1 globals

Alphathree33

Platinum Member
Dec 1, 2000
2,419
0
0
I need to be able to define in a file somewhere some custom global variables that will be accessible from any JSP page Tomcat serves.

Is there an easy way to do this?

 

manly

Lifer
Jan 25, 2000
13,591
4,240
136
Declarative:
Servlet Context Initialization parameters (I hope I got the term correct).

Programmatic:
Static final members in a Java class.

The second is just the basic method in Java (and unimportantly, slightly faster). Of course it locks you into compile-time values. Go with the first approach unless you need something different. ;)