Package com.yummynoodlebar.config

Source Code of com.yummynoodlebar.config.WebAppInitializer

package com.yummynoodlebar.config;

import javax.servlet.Filter;

import org.springframework.core.annotation.Order;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

@Order(2)
public class WebAppInitializer extends
    AbstractAnnotationConfigDispatcherServletInitializer {

  //{!begin addToRootContext}
  @Override
  protected Class<?>[] getRootConfigClasses() {
    return new Class<?>[] { SecurityConfig.class, PersistenceConfig.class, CoreConfig.class };
  }
  //{!end addToRootContext}

  @Override
  protected Class<?>[] getServletConfigClasses() {
    return new Class<?>[] { WebConfig.class };
  }

  @Override
  protected String[] getServletMappings() {
    return new String[] { "/" };
  }
 
  @Override
  protected Filter[] getServletFilters() {
   
    CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter();
    characterEncodingFilter.setEncoding("UTF-8");
    return new Filter[] { characterEncodingFilter};
  }

}
TOP

Related Classes of com.yummynoodlebar.config.WebAppInitializer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.