Add a runtime first and select project properties. Then check the server name from the ‘Runtimes’ tab as shown in the image.
Include servlet-api-3.1.jar in your dependencies.
Maven
Gradle
configurations {
provided
}
sourceSets {
main { compileClasspath += configurations.provided }
}
dependencies {
provided ‘javax.servlet:javax.servlet-api:3.1.0’
}