parent
afaae8e64b
commit
eb3453240c
@ -1,46 +1,41 @@ |
||||
package org.pqh.config; |
||||
|
||||
import org.springframework.web.WebApplicationInitializer; |
||||
import org.springframework.web.filter.CharacterEncodingFilter; |
||||
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; |
||||
|
||||
import javax.servlet.ServletContext; |
||||
import javax.servlet.ServletException; |
||||
import javax.servlet.Filter; |
||||
|
||||
/** |
||||
* Created by reborn on 2017/7/28. |
||||
*/ |
||||
|
||||
public class WebConfig implements WebApplicationInitializer { |
||||
public class WebConfig extends AbstractAnnotationConfigDispatcherServletInitializer { |
||||
|
||||
private String encoding ="UTF-8"; |
||||
|
||||
|
||||
@Override |
||||
protected Filter[] getServletFilters() { |
||||
return new Filter[]{new CharacterEncodingFilter(encoding)}; |
||||
} |
||||
|
||||
// @Override
|
||||
// protected Filter[] getServletFilters() {
|
||||
// org.springframework.web.SpringServletContainerInitializer
|
||||
// org.springframework.web.SpringServletContainerInitializer
|
||||
// return new Filter[]{new CharacterEncodingFilter(encoding)};
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected String[] getServletMappings() {
|
||||
// return new String[]{"/"};
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected Class<?>[] getRootConfigClasses() {
|
||||
// return new Class[0];
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected Class<?>[] getServletConfigClasses() {
|
||||
// return new Class[]{SpringConfig.class};
|
||||
// }
|
||||
@Override |
||||
protected String[] getServletMappings() { |
||||
return new String[]{"/"}; |
||||
} |
||||
|
||||
@Override |
||||
public void onStartup(ServletContext servletContext) throws ServletException { |
||||
protected Class<?>[] getRootConfigClasses() { |
||||
return new Class[0]; |
||||
} |
||||
|
||||
@Override |
||||
protected Class<?>[] getServletConfigClasses() { |
||||
return new Class[]{SpringConfig.class}; |
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
|
@ -0,0 +1,8 @@ |
||||
package org.pqh.util; |
||||
|
||||
/** |
||||
* Created by reborn on 2017/8/8. |
||||
*/ |
||||
public class Log4jUtil { |
||||
|
||||
} |
Loading…
Reference in new issue