为什么无法打包编译成class????
为什么无法打包编译成class????怎么处理??谢谢各位大咖。import javax.servlet.*;
import java.io.IOException;
importjavax.servlet.ServletRequest;
importjavax.servlet.ServletResponse;
importjavax.servlet.ServletConfig;
public class MyServlet implementsServlet {
public void init(ServletConfig servletConfig)throwsServletException {
}
publicvoid service(ServletRequest request,ServletResponse response)throws ServletException, IOException{
}
public void destroy() {
}
public ServletConfig getServletConfig() {
return null;
}
public String getServletInfo(){
returnnull;
}
}
E:\java01>javac MyServlet.java
MyServlet.java:3: 错误: 程序包javax.servlet不存在
importjavax.servlet.ServletRequest;
^
MyServlet.java:4: 错误: 程序包javax.servlet不存在
importjavax.servlet.ServletResponse;
^
MyServlet.java:5: 错误: 程序包javax.servlet不存在
importjavax.servlet.ServletConfig;
^
MyServlet.java:8: 错误: 找不到符号
public class MyServlet implementsServlet {
^
符号: 类 Servlet
MyServlet.java:9: 错误: 找不到符号
public void init(ServletConfig servletConfig)throwsServletException {
^
符号: 类 ServletConfig
位置: 类 MyServlet
MyServlet.java:9: 错误: 找不到符号
public void init(ServletConfig servletConfig)throwsServletException {
^
符号: 类 ServletException
位置: 类 MyServlet
MyServlet.java:12: 错误: 找不到符号
publicvoid service(ServletRequest request,ServletResponse response)throws ServletException, IOException{
^
符号: 类 ServletRequest
位置: 类 MyServlet
MyServlet.java:12: 错误: 找不到符号
publicvoid service(ServletRequest request,ServletResponse response)throws ServletException, IOException{
^
符号: 类 ServletResponse
位置: 类 MyServlet
MyServlet.java:12: 错误: 找不到符号
publicvoid service(ServletRequest request,ServletResponse response)throws ServletException, IOException{
^
符号: 类 ServletException
位置: 类 MyServlet
MyServlet.java:20: 错误: 找不到符号
public ServletConfig getServletConfig() {
^
符号: 类 ServletConfig
位置: 类 MyServlet
MyServlet.java:1: 错误: 程序包javax.servlet不存在
import javax.servlet.*;
^
11 个错误 {:10_249:}引个servlet-api.jar
页:
[1]