سؤال

I have some web apps hosted in Tomcat container, Can we engage a Valve specifically for a webapp ? Please give me a way.

هل كانت مفيدة؟

المحلول

Yes, you put the valve directive into your context.xml as follows.

<Context path="/myapp" ...>
  ...
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="10.1.2.*"/>
</Context>

I found this page to be a good tutorial on writing your own valve.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top