/**
   * Get and stores in the servlet the application bean's name in the Spring's context. It's
   * expected to be configured as a the servlet <code>init-param</code> named
   * applicationBeanName. If no param is found, the default is "application".
   *
   * @see AbstractApplicationServlet#init(ServletConfig)
   */
  @Override
  public void init(ServletConfig config) throws ServletException {

    super.init(config);

    String name = config.getInitParameter("applicationBeanName");

    this.name = name == null ? DEFAULT_APP_BEAN_NAME : name;
  }
 @SuppressWarnings("unchecked")
 @Override
 public void init(ServletConfig servletConfig) throws ServletException {
   if (logger.isDebugEnabled()) {
     logger.debug("init()");
   }
   super.init(servletConfig);
   applicationBean = servletConfig.getInitParameter("applicationBean");
   if (applicationBean == null) {
     throw new ServletException("ApplicationBean not specified in servlet parameters");
   }
   applicationContext =
       WebApplicationContextUtils.getWebApplicationContext(servletConfig.getServletContext());
   applicationClass = (Class<? extends Application>) applicationContext.getType(applicationBean);
   initLocaleResolver(applicationContext);
 }