Im trying to create servlet for my project but encountered The import javax.servlet.annotation cannot be resolved
. I've already added javax.servlet
and servlet-api.jar
from tomcat. Please refer the image below.
By the screenshot it looks like you are importing servlet spec v2.5. The servlet annotations were added in servlet spec 3.0
http://docs.oracle.com/javaee/6/api/javax/servlet/annotation/package-summary.html
You will want to get the jar for a newer version then what you are currently using
Here is a chart showing the Tomcat version and the servlet spec it supports http://tomcat.apache.org/whichversion.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With