我已经开始编写可以在 Google App Engine 上运行的应用程序。
但是当我想使用从 Netbeans 到 Eclipse 的代码时,我遇到了以下错误:
import javax.servlet.annotation.WebServlet;
和
@WebServlet(name = "MyServlet", urlPatterns = {"/MyServlet"})
错误是:
The import javax.servlet.annotation cannot be resolved
WebServlet cannot be resolved to a type
我尝试将其导入servlet-api.jar
Eclipse 但仍然相同,还尝试构建和清理项目。我不在我的 Eclipse 上使用 Tomcat,只在我的 Netbeans 上使用它。我该如何解决这个问题?