Hi Alok,

i think you have to make a distinction between the different items you list
below:

Alok Mehta wrote:

> A general question about writing servlets...
>
> I would like to have a class or object in my servlet where I can go to find
> out misc. information
> - the HttpServletRequest object
> - authentication information (userid, permissions)

This information is specific for every session so it is the best to tie it to
the HttpSession-Object.

> - database connection information
> - audit management objects, and objects for loggin activity
> etc.

This is, like the 'System.out', used by all servlet instances and all sessions,
so one way to store this is too use one or many  singletons. The singleton
classes don't implement the servlet interface.

-Henning
begin:vcard
n:Brune;Henning
tel;fax:+49 (0)5 21/1 06-64 40
tel;work:+49 (0)5 21/1 06-29 48
x-mozilla-html:FALSE
org:Universitaet Bielefeld;Technische Fakultaet, AG TI
adr:;;Postfach 100131;Bielefeld;NRW;33501;Germany
version:2.1
email;internet:[EMAIL PROTECTED]
title:Dipl.-Inform.
fn:Henning Brune
end:vcard

S/MIME Cryptographic Signature

Reply via email to