tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felipe Schnack <feli...@ritterdosreis.br>
Subject RE: servlets
Date Tue, 28 Jan 2003 21:32:05 GMT
  Well, the short answer is that I need instance variable values from a
servlet (in this case, data from ServletConfig). I could certainly make
my classes ask for the servlet instance as a method parameter, but this
just looks so ugly to my perfectionist eyes :-)

On Tue, 2003-01-28 at 19:27, Wendy Smoak wrote:
> > yes, I know how to do it (private constructor, etc), but how tomcat
> > will call an getInstance() method instead of create a new instance of
> > it?
> 
> No... you move the sensitive code *out* of the Servlet into a Singleton, and
> then code in your Servlet interacts with that Singleton.
> 
> Can you post a snippet of code that shows what you're trying to do and why
> you're trying to make your Servlet a Singleton?  Maybe someone will have a
> suggestion.
> 
> -- 
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University PA Information Resources Management
-- 

Felipe Schnack
Analista de Sistemas
felipes@ritterdosreis.br
Cel.: (51)91287530
Linux Counter #281893

Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
ritter@ritterdosreis.br
Fone/Fax.: (51)32303341


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message