Check that the version number of your servlet-api.jar
is at least 3.0. There is a version number inside the jar in the META-INF/manifest.mf
file:
Implementation-Version: 3.0.1
If it's less than 3.0 download the 3.0.1 from Maven Central: http://search.maven.org/#artifactdetails|javax.servlet|javax.servlet-api|3.0.1|jar
Former servlet specifications (2.5, 2.4 etc.) do not support annotations.