----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

> ----------------------------------------------------------------
> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
> WHEN YOU POST, include all relevant version numbers, log files,
> and configuration files.  Don't make us guess your problem!!!
> ----------------------------------------------------------------
>
> Hi,
>
>>> if you want that to work, then you'll need to put the reading of the config
>>> parameters in something other that the init() method.  Typically, the
> init()
>>> method is called only once, when the servlet is instantiated the first
> time.
>>
>>There is a private method that actually loads the file and copies the values
>>to global vars.  This method is called in the init and when the correct
>>querystring is present.
>>
>>> Try reading the config file in the processRequest method instead.
>
> He's absolutely right.
> The servlet init() method is only guaranteed to be called once in the
> life of the servlet engine (or whenever the .class file changes and it is
> reloaded).  Once the servlet is instantiated in the servlet engine, it
> services many requests (i.e. doGet()).
>
>>I'd rather not do this since it would then load the file on every hit.
>
> It wouldn't be load every hit.  Only when you determine that the "correct
> querystring is present".

Right, I misunderstood.  This is exactly what I'm doing.  MY problem isn't
getting to method to run when I want, its already doing that, its that when
it runs, it doesn't read the new properties file.  The object contains the
old data.

Let me try and explain again.  The problem has nothing to do with where the
method is called.  It has to do with changes in the property file only being
recognized once.  If I call the method from a command line java app 100
times, it recognizes the changes 100 times.  If I call it 100 times from a
servlet, it recognizes only the first change and then returns that same
object the other 99 times regardless of any changes made to the file.

Does this make any sense?

Thanks,
Thad


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to