@Override public void customize(ConfigurableEmbeddedServletContainer container){
  MimeMappings mappings=new MimeMappings(MimeMappings.DEFAULT);
  mappings.add("html","text/html;charset=utf-8");
  mappings.add("json","text/html;charset=utf-8");
  container.setMimeMappings(mappings);
  File root;
  if (env.acceptsProfiles(Constants.SPRING_PROFILE_PRODUCTION)) {
    root=new File("build/www/");
  }
 else {
    root=new File("src/main/webapp/");
  }
  if (root.exists() && root.isDirectory()) {
    container.setDocumentRoot(root);
  }
}

@ Override public void customize ( ConfigurableEmbeddedServletContainer container ) { MimeMappings mappings = new MimeMappings ( MimeMappings . DEFAULT ) ; mappings . add ( "html" , "text/html;charset=utf-8" ) ; mappings . add ( "json" , "text/html;charset=utf-8" ) ; container . setMimeMappings ( mappings ) ; File root ; if ( env . acceptsProfiles ( Constants . SPRING_PROFILE_PRODUCTION ) ) { root = new File ( "build/www/" ) ; } else { root = new File ( "src/main/webapp/" ) ; } if ( root . exists ( ) && root . isDirectory ( ) ) { container . setDocumentRoot ( root ) ; } }
set up mime types and , if needed , set the document root .
