Question

What is the need of using init-parameters in servlet configuration? If answer is to let the servlet initialize it's parameters, then the question to this answer is "Does this initialized value persists when server boots next time to instantiate the Servlet again?". Storing these parameters on file can be a better option then. I just want to clarify if I can set the value of init-parameter in destroy() so that when server boots next time it will have updated value for this parameter in init().

Était-ce utile?

Autres conseils

Yes to your first question, no for the second. Init parameters are supposed to be used within ServletConfig object, but they are immutable (how can you do setInitParameter?)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top