Introduction
This tip gives explains how to fix this error: import javax.servlet.ServletRegistration.Dynamic cannot be found.
Background
I downloaded spring-mvc-chat from https://github.com/rstoyanchev/spring-mvc-chat but when trying to import some code parts, got an irritating import error:
import javax.servlet.ServletRegistration.Dynamic cannot be found
Using the code
The problem was a missing Maven dependency:
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_3.0_spec</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>