Package com.yummynoodlebar.config

Source Code of com.yummynoodlebar.config.WebAppInitializer

package com.yummynoodlebar.config;

import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

import javax.servlet.Filter;

// {!begin top}
public class WebAppInitializer extends
    AbstractAnnotationConfigDispatcherServletInitializer {
// {!end top}

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

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

  // {!begin servletConfig}
  @Override
  protected String[] getServletMappings() {
    return new String[] { "/" };
  }

  @Override
  protected Filter[] getServletFilters() {

    CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter();
    characterEncodingFilter.setEncoding("UTF-8");
    return new Filter[] { characterEncodingFilter};
  }
  // {!end servletConfig}
}
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.