Hi Insosh Its true that you need to register the valve in tomcat. But I think since you need to filter out context you need to register in a context. Refer to [1].
[1] http://tomcat.apache.org/tomcat-5.5-doc/config/context.html#Request_Filters Thanks & Regards Danushka Fernando Software Engineer WSO2 inc. http://wso2.com/ Mobile : +94716332729 On Mon, Sep 15, 2014 at 10:56 AM, Chamil Jeewantha <[email protected]> wrote: > Hi Inosh, > > You can write a new valve for your work and simply register it with > catalina-server.xml. Multiple valves are allowed in Tomcat. You can see > there are many valves defined in the catalina-server.xml in the following > example. > > <Engine name="Catalina" defaultHost="localhost"/> > <!--Realm className="org.apache.catalina.realm.MemoryRealm" > pathname="${carbon.home}/repository/conf/tomcat/tomcat-users.xml"/--> > <Realm className= > "org.wso2.carbon.tomcat.ext.realms.CarbonTomcatRealm"/> > <Host name="localhost" unpackWARs="true" deployOnStartup="false" > autoDeploy="false" appBase= > "${carbon.home}/repository/deployment/server/webapps/"> > <Valve className= > "org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve"/> > <Valve className="org.apache.catalina.valves.AccessLogValve" > directory="${carbon.home}/repository/logs" > prefix="http_access_" suffix=".log" > pattern="combined" /> > <Valve className= > "org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve" > threshold="600"/> > <Valve className= > "org.wso2.carbon.tomcat.ext.valves.CompositeValve"/> > </Host> > </Engine> > > Regards, > Chamil > > On Mon, Sep 15, 2014 at 10:41 AM, Inosh Perera <[email protected]> wrote: > >> Hi all, >> I need to write a custom Tomcat valve, to filter out some context. This >> is for EMM where API manager is included as a feature. I understand that >> currently, all the requests goes through APIManagerInterceptorValve. So >> since API manager is added to EMM as a feature, when I write a custom >> valve, how do I add it to EMM, since the existing valve comes from API >> manager? >> >> Regards, >> Inosh >> -- >> Inosh Perera >> Software Engineer, WSO2 Inc. >> Tel: 0785293686 >> > > > > -- > K.D. Chamil Jeewantha > Associate Technical Lead > WSO2, Inc.; http://wso2.com > http://kdchamil.blogspot.com > Mobile: +94716813892 > > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
