Hi,
I want to use init() to do some stuff with config and context init-params in my
servlet. One of the things I want to do is open a DB connection, which I believe is quite a common use of init().
Anyway, I am learning about all this stuff by reading HF Servlets and
JSP, in which I seem to remember it saying that instance variables in servlets are a bad idea. I only actually _need_ the DB connection briefly in order to read some configuration data in, so I could actually keep that object method local within init(). However, I would like to keep a copy of the connection parameters so I can display them in a JSP later, but the only way my small brain can see to do this is to store them in an instance variable (like HashMap). I can't, for example, do
because at the init() stage there is no context!
Can anyone suggest what to do here? Where can I store these params for later without using an instance variable? Do I even need to? I'm confused
thanks,
Ben