选择新建Maven project
packaging 选择 war
在pom.xml填入:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<!-- define the project compile level -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
选择项目右键->Properties
1. Resource 修改项目Encode 为 UTF-8
2. Java BuildPath 修改项目JRE版本
3. Java Complier 修改项目编译版本
4. Project Facets 勾选下图选项
完成以上步骤后 在 src->main->webapp目录下建立WEB-INF 等相关 目录
完成