How to Change init-parameters at Runtime?

java, servlets

Solution

It's called `init-parameter` for a reason. So, you can't.

But you can change values at runtime, that's no problem.

- After reading the init parameters put them as attributes of the `ServletContext` (`ctx.setAttribute("name", value)`)

- Create a small (password-protected) page that lists all attributes of the `ServletContext` and gives the ability to change them.

Problem

If I modify the XML to change the value of init parameter I see the changes only when web-app is redeployed. My question is cant I get around this by setting the values at run time.Is there any API that allow me to change the values dynamically.

Original source