[英]package javax.servlet does not exist on Tomcat
I am writing JApplet in Netbeans.我正在用 Netbeans 编写 JApplet。 My applet is working, so I decide to add servlet because I want to have log in/out.我的小程序正在运行,所以我决定添加 servlet,因为我想登录/注销。 When I added servlet to my project as follows:当我将 servlet 添加到我的项目时,如下所示:
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
I had the following errors:我有以下错误:
error: package javax.servlet does not exist
import javax.servlet.ServletException;
error: package javax.servlet.http does not exist
import javax.servlet.http.HttpServlet;
Apache Tomcat is working. Apache Tomcat 正在运行。
Add servlet jar to the classpath in your IDE. 将servlet jar添加到IDE中的类路径。 Your webcontainer will provide it at runtime. 您的Web容器将在运行时提供它。 You don't have to bundle it in your WAR 您不必将其捆绑在WAR中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.