Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The following page has been changed by xxd82329:
http://wiki.apache.org/tomcat/SummerOfCode2009/LoadingFilterConfiguration

------------------------------------------------------------------------------
  
  For global level filters(for all the servlet in this tomcat instance), we 
have conf/web.xml file to put configurations. And for servlet level 
filters(wrapper level in tomcat), we have individual web.xml files too. The 
question is, what if the filter should  be engine/host/context level, where do 
we put the configuration? 
  
- I think we could add those configurations into conf/server.xml, and we could 
also support "$CATALINA_BASE/conf/[enginename]/engine-filters.default" for 
engine level filters, 
"$CATALINA_BASE/conf/[enginename]/[hostname]/host-filters.default" for host 
level filters and 
"$CATALINA_BASE/conf/[enginename]/[hostname]/context.xml.default" for context 
levelfilters just as tomcat do now for "context.xml.default". 
+ Here are some options I could bring to my mind:
+  
+ 1: we could add those configurations into conf/server.xml
  
- Are there any other places that could put the configurations for those 
converted filters? Any comments are welcomed. Thank you for your time. 
+ pros: the place for configuration keeps consistent with that of valves. And 
we could also use similar syntax as valves. So I think this is least abrupt way 
for configurating filters.
  
+ cons: Maybe a little strange to config somewhat general Servlet structure 
into a tomcat specific configuration file. And need some hacking for squeezing 
those configurated filters into filter chain.
+ 
+ 2: we could also support 
"$CATALINA_BASE/conf/[enginename]/engine-filters.default" for engine level 
filters, "$CATALINA_BASE/conf/[enginename]/[hostname]/host-filters.default" for 
host level filters and 
"$CATALINA_BASE/conf/[enginename]/[hostname]/context.xml.default" for context 
levelfilters just as tomcat do now for "context.xml.default"
+ 
+ pros: keep consistent with valves. And somewhat the same as the first method. 
I think this could be the complement of the first one. 
+ 
+ cons: But I think this way is more verbose than the first, since 
configuration scattered into several places. Considering the situation of 
valves, there are not too many filters need to be configurated in this way.
+ 
+ 
+ 3: Put all those converted filters into the global conf/web.xml, and using 
some extra parameters to determine the level(server/engine/host/context) which 
this filter belongs to. 
+ 
+ pros: keep consistent with the Servlet specification. And maybe least source 
code that need to write.
+ 
+ cons: the global conf/web.xml file is rather long now. Scrolling this file 
and adding or altering it could become a burden to developer to some degree. 
+ 
+ 
+ 
+ 
+ Are there any other places or methods that could put the configurations for 
those converted filters? Any comments are welcomed. Thank you for your time. 
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to