Hello, is it possible to change the context file in
$CATALINA_HOME/conf/Catalina/localhost/app.xml
so that application would get the new configuration without restarting?
I could not find such thing in servlet specification.
Or would it be possible to manually read the file from the application, for
example once a minute?
Now the application gets the configuration from init():
javax.servlet.GenericServlet.java
/**
* Called by the servlet container to indicate to a servlet that the
* servlet is being placed into service. See {@link Servlet#init}.
*
* <p>This implementation stores the {@link ServletConfig}
* object it receives from the servlet container for later use.
* When overriding this form of the method, call
* <code>super.init(config)</code>.
*
* @param config
the <code>ServletConfig</code> object
*
that contains
configutation
*
information for
this servlet
*
* @exception ServletException if an exception occurs
that
*
interrupts the
servlet's normal
*
operation
*
* @see
UnavailableException
*/
public void init(ServletConfig config) throws ServletException {
this.config = config;
this.init();
}
I suppose that getServletConfig() returns the same cached data without
re-reading it from disk?
/**
* Returns this servlet's {@link ServletConfig} object.
*
* @return ServletConfig the <code>ServletConfig</code> object
*
that initialized this servlet
*/
public ServletConfig getServletConfig() {
return config;
}
-Harri