2017-01-13 5 views
0

変更できないwar-fileを想像してみてください。 .warファイルのweb.xmlは、init-param要素(ではなく、:サーブレットコンテキストパラメータ)のセットを持つサーブレットを定義します。Tomcat:web.xmlサーブレットinit-paramを無効にする方法

使用のTomcat 7、これらのパラメータの一部オーバーライドする方法はありますか? Tomcatのconfに/ web.xmlの
(戦争-ファイルから抽出web.xmlを変えるの横)

+0

、あなたは、このリンクをチェックすることができますhttp://tomcat.apache.org/tomcat-4.1-doc/config /context.htmlとトピック、つまり自動コンテキスト設定。 –

+0

@TahirHussainMirこのurlはサーブレットのinit-paramについて何も言わない。おそらく、それらをサーブレット・コンテキスト・パラメータと混同したでしょう。 – MRalwasser

答えて

0
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. 
+0

小さなコメントと同じように:他の多くのアプリケーションサーバーでは、これらの値を上書きできます。 – MRalwasser

関連する問題