添加 javax.servlet jar包

master
无限超频 7 years ago committed by luffy9412
parent afaae8e64b
commit eb3453240c
  1. 7
      pom.xml
  2. 47
      src/main/java/org/pqh/config/WebConfig.java
  3. 8
      src/main/java/org/pqh/util/Log4jUtil.java

@ -15,6 +15,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<mysql.version>6.0.6</mysql.version>
<spring.version>4.3.10.RELEASE</spring.version>
</properties>
<dependencies>
@ -22,19 +23,19 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>RELEASE</version>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>RELEASE</version>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>RELEASE</version>
<version>${spring.version}</version>
</dependency>
<dependency>

@ -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…
Cancel
Save