tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Question about context-param
Date Thu, 16 Jan 2003 20:15:52 GMT

>Sorry 2 different Contexts, and my brain was all messed up.  When I'm
>refering to my Context
>Constructor it's actually the main servlet constructor (which in our
app is
>PolarisContext).  Which
>extends HttpServlet.

OK, that makes a bit more sense.  Although a similar argument applies.
Even though a servlet is a normal class, and you can create a
constructor for it and do stuff in the constructor, you probably
shouldn't.  Instead, stick with overriding Servlet methods, in this case
init.  The container is required to make the servlet context parameters
available to your servlet's init() method.  It's not required to make
them available to your servlet's constructor.  So for portability and a
little bit less of a headache, you're better off not writing a servlet
constructor and moving the constructor code to the servlet's init()

Yoav Shapira
Millennium ChemInformatics

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message