log.infof("NutFilter[%s] starting ...", conf.getFilterName());
Mvcs.setServletContext(conf.getServletContext());
this.selfName = conf.getFilterName();
Mvcs.set(selfName, null, null);
FilterNutConfig config = new FilterNutConfig(conf);
Mvcs.setNutConfig(config);
handler = new ActionHandler(config);
String regx = Strings.sNull(config.getInitParameter("ignore"), IGNORE);
if (!"null".equalsIgnoreCase(regx)) {
ignorePtn = Pattern.compile(regx, Pattern.CASE_INSENSITIVE);
}
String exclusions = config.getInitParameter("exclusions");
if (exclusions != null) {
String[] tmps = Strings.splitIgnoreBlank(exclusions);
Set<String> prefix = new HashSet<String>();
Set<String> suffix = new HashSet<String>();
Set<String> paths = new HashSet<String>();
for (String tmp : tmps) {
tmp = tmp.trim().intern();
if (tmp.length() > 1) {
if (tmp.startsWith("*")) {
prefix.add(tmp.substring(1));
continue;
} else if (tmp.endsWith("*")) {
suffix.add(tmp.substring(0, tmp.length() - 1));
continue;
}
}
paths.add(tmp);
}
if (prefix.size() > 0) {
exclusionsPrefix = Pattern.compile("^("+Lang.concat("|", prefix)+")", Pattern.CASE_INSENSITIVE);
log.info("exclusionsPrefix = " + exclusionsPrefix);
}
if (suffix.size() > 0) {
exclusionsSuffix = Pattern.compile("^("+Lang.concat("|", suffix)+")", Pattern.CASE_INSENSITIVE);
log.info("exclusionsSuffix = " + exclusionsSuffix);
}
if (paths.size() > 0) {
exclusionPaths = paths;
log.info("exclusionsPath = " + exclusionPaths);
}
}
sp = config.getSessionProvider();
}