code: public static GrailsApplication findApplication(ServletContext servletContext) {
          ApplicationContext wac = findApplicationContext(servletContext);
          if(wac != null) {
              return (GrailsApplication)wac.getBean(GrailsApplication.APPLICATION_ID);
          }
          return null;
      }
docs: Looks up the GrailsApplication instance
  
  @return The GrailsApplication instance