<!-- we need to add the Servlet API dependency: javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
Right click on project --->
Properties --->
Java Build Path --->
Add Library... --->
Server Runtime --->
Apache Tomcat ----> Finish.