想象一下你无法改变的战争文件。 .war文件的web.xml
使用一组init-param
元素定义servlet(不:servlet上下文参数)。
使用 Tomcat 7 ,有没有办法覆盖其中一些参数?
(旁边更改战争文件中提取的web.xml
)
答案 0 :(得分:-1)
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.