I agree that global properties are not ideal, it would be much better to be
able to localise them for each web-application, I thought I would start by
not asking for too much!  From the replies that I have seen so far I will
give the <context-param> element a go.  Basically setting a parameter for a
particular web app which I agree means your web apps are less likely to have
name clashes with parameters they set, as is the case with System
properties, hence more encapsulated.

Stu

-----Original Message-----
From: Jim Rudnicki [mailto:[EMAIL PROTECTED]]
Sent: 20 November 2000 03:11
To: [EMAIL PROTECTED]
Subject: Re: System properties

> From the looks of things, it is just the way it is, although I was hoping
> the there would be some way to put stuff in the web.xml file, maybe in the
> servlet tag like:
>
> <system-property>
> <name>myproperty</name>
> <value>42</value>
> </system-property>
>
> Anyone think this is a good idea, or am I talking rubbish?

It's a bad idea.  Keep your web-apps encapsulated.

There is two ways to think about a "global" service:
- providing a service to many servlets, seems like a good thing
or
- bleeding out dependencies upon those that don't need them and allowing
access to those that shouldn't be using it.  bad things

> PS. static, bad?  It is useful! ...

she said and meant _static initializers_ = bad, not static methods, and
members.  I concur.

Jim

Reply via email to