Callback function postInit in StrutsPrepareAndExecuteFilter init method

If you configure the StrutsPrepareAndExecuteFilter class directly in web.xml, this function is useless, but if you write a listener to inherit this class, you can add your own logic in the postInit method to achieve expansion.

 

 for example:

class MyPrepareAndExecuteFilter extends StrutsPrepareAndExecuteFilter{

  protected void postInit(Dispatcher dispatcher, FilterConfig filterConfig) {
    System.out.println("call back source code");
  }
}
Then configure MyPrepareAndExecuteFilter into filter in web.xml.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326675737&siteId=291194637