|
楼主 |
发表于 2005-10-1 22:02:19
|
显示全部楼层
我的程序附上,如下
import java.io.*;
import javax.servlet.*;
import java.servlet.http.*;
public class servlet extends HttpServlet
{
public void doget(HttpServletRequest request,HttpServletReponse response)
throws IOException,ServletException
{
response.setContentType("text/html");
PrintWriter out=response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>example</title>");
out.println("</head>");
out.println("<body>");
out.println("<h2 align=\" center\">hello</h2");
out.println("</body>");
out.println("<html>");
out.close();
}
}
编译后,出现如下错误
D:\Program Files\Java\myclass>javac servlet.java
servlet.java:3: 软件包 java.servlet.http 不存在
import java.servlet.http.*;
^
servlet.java:4: 找不到符号
符号: 类 HttpServlet
public class servlet extends HttpServlet
^
servlet.java:6: 找不到符号
符号: 类 HttpServletRequest
位置: 类 servlet
public void doget(HttpServletRequest request,HttpServletReponse respons
)
^
servlet.java:6: 找不到符号
符号: 类 HttpServletReponse
位置: 类 servlet
public void doget(HttpServletRequest request,HttpServletReponse respons
)
^
4 错误
这到底是少了哪个文件,能否传到我的邮箱内hackersend@yahoo.com.cn |
|