package com.ctrip.framework.apollo.common.controller;

import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.http.MediaType;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import java.util.List;

@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {

  @Override
  public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
    PageableHandlerMethodArgumentResolver pageResolver =
            new PageableHandlerMethodArgumentResolver();
    pageResolver.setFallbackPageable(new PageRequest(0, 10));

    argumentResolvers.add(pageResolver);
  }

  @Override
  public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.favorPathExtension(false);
    configurer.ignoreAcceptHeader(true).defaultContentType(MediaType.APPLICATION_JSON);
  }

}

@@ -44,24 +44,259 @@
 ontroller;%0A%0A
+import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;%0Aimport org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;%0Aimport org.springframework.boot.context.embedded.MimeMappings;%0A
 import org.s
@@ -344,16 +344,16 @@
 ration;%0A
-
 import o
@@ -858,16 +858,62 @@
 Adapter 
+implements EmbeddedServletContainerCustomizer 
 %7B%0A%0A  @Ov
@@ -1466,10 +1466,263 @@
 );%0A  %7D%0A%0A
+  @Override%0A  public void customize(ConfigurableEmbeddedServletContainer container) %7B%0A    MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);%0A    mappings.add(%22html%22, %22text/html;charset=utf-8%22);%0A    container.setMimeMappings(mappings );%0A  %7D%0A
 %7D%0A

add html mime type as utf-8