如果直接在web.xml里配置这个StrutsPrepareAndExecuteFilter类,这个函数是没用的,但如果自己写个监听器继承这个类,在postInit方法里可以添加自己的逻辑,实现拓展。
比如:
class MyPrepareAndExecuteFilter extends StrutsPrepareAndExecuteFilter{
protected void postInit(Dispatcher dispatcher, FilterConfig filterConfig) {
System.out.println("call back source code");
}
}
然后在web.xml中把MyPrepareAndExecuteFilter配置到filter中。