parent
afaae8e64b
commit
eb3453240c
@ -1,46 +1,41 @@ |
|||||||
package org.pqh.config; |
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.Filter; |
||||||
import javax.servlet.ServletException; |
|
||||||
|
|
||||||
/** |
/** |
||||||
* Created by reborn on 2017/7/28. |
* Created by reborn on 2017/7/28. |
||||||
*/ |
*/ |
||||||
|
|
||||||
public class WebConfig implements WebApplicationInitializer { |
public class WebConfig extends AbstractAnnotationConfigDispatcherServletInitializer { |
||||||
|
|
||||||
private String encoding ="UTF-8"; |
private String encoding ="UTF-8"; |
||||||
|
|
||||||
|
|
||||||
|
@Override |
||||||
|
protected Filter[] getServletFilters() { |
||||||
|
return new Filter[]{new CharacterEncodingFilter(encoding)}; |
||||||
|
} |
||||||
|
|
||||||
// @Override
|
@Override |
||||||
// protected Filter[] getServletFilters() {
|
protected String[] getServletMappings() { |
||||||
// org.springframework.web.SpringServletContainerInitializer
|
return new String[]{"/"}; |
||||||
// 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 |
@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