Import javax servlet. Annotation cannot be resolved

I tried to create a servlet for my project, but I encountered import javax servlet. Annotation cannot be resolved I have added javax. XML from Tomcat Servlet and servlet API jar. Please refer to the figure below

Solution

The screenshot looks like you are importing servlet specification v2 5. Servlet comments have been added to servlet specification 3.0

http://docs.oracle.com/javaee/6/api/javax/servlet/annotation/package-summary.html

You will want to get a newer version of the jar and then what you are using

This is a diagram showing the Tomcat version and the servlet specifications it supports http://tomcat.apache.org/whichversion.html

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>