J
jerjoan
Unregistered / Unconfirmed
GUEST, unregistred user!
我的环境是jdk1.4.1_02,tomcat4.0.6,我写一个段小的serlvet程序如下
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet{
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
response.setContextType("text/html");
ServletOutputStream out = response.getOutputStream();
out.println("<html>");
out.println("<head>");
String title = "Hello World";
out.println("<title>" + title + "</title>");
out.println("</head>");
out.println("<body bgcolor = /"white/">");
out.println("<body>");
out.println("<h1>" + title + "</h1>");
out.println("</body>");
out.println("</html>");
}
}
用javac编译后报错说 找不到包javax.servlet.*
找不到包javax.servlet.http.*;
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet{
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
response.setContextType("text/html");
ServletOutputStream out = response.getOutputStream();
out.println("<html>");
out.println("<head>");
String title = "Hello World";
out.println("<title>" + title + "</title>");
out.println("</head>");
out.println("<body bgcolor = /"white/">");
out.println("<body>");
out.println("<h1>" + title + "</h1>");
out.println("</body>");
out.println("</html>");
}
}
用javac编译后报错说 找不到包javax.servlet.*
找不到包javax.servlet.http.*;