public void destroy() {
    WebApplicationContext webContext = getWebApplicationContext();
    GrailsApplication application =
        (GrailsApplication)
            webContext.getBean(GrailsApplication.APPLICATION_ID, GrailsApplication.class);

    GrailsClass[] bootstraps = application.getArtefacts(BootstrapArtefactHandler.TYPE);
    for (int i = 0; i < bootstraps.length; i++) {
      ((GrailsBootstrapClass) bootstraps[i]).callDestroy();
    }
    super.destroy();
  }
 protected void initFrameworkServlet() throws ServletException, BeansException {
   super.initFrameworkServlet();
   initMultipartResolver();
 }