* Define a filter for a context and set up default url mappings.
*/
protected void defineFilter(WebApplicationContext ctx, String name,
String classname, Map<String, String> parameters, String[] urls) {
WebApplicationHandler handler = ctx.getWebApplicationHandler();
FilterHolder holder = handler.defineFilter(name, classname);
if (parameters != null) {
for(Map.Entry<String, String> e : parameters.entrySet()) {
holder.setInitParameter(e.getKey(), e.getValue());
}
}
for (String url : urls) {
handler.addFilterPathMapping(url, name, Dispatcher.__ALL);
}
}