java在编译时出现"软件包java.Servlet不存在","软件包java.Servlet.Http不存在"等5个错误能不能帮我改改
程序如下:importjavax.Servlet.*;importjavax.Servlet.http.*;importjava.io.*;publicclassServ...
程序如下:
import javax.Servlet.*;
import javax.Servlet.http.*;
import java.io.*;
public class Serv1 extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException{
PrintWriter out =response.getWriter();
java.util.Date today=new java.util.Date();
out.println("<html>"+
"<body>"+
"<h1 align=center>HF's chapter1 Servlet</h1>"
+"<br>"+today+"</body>"+"</html>");
}
} 展开
import javax.Servlet.*;
import javax.Servlet.http.*;
import java.io.*;
public class Serv1 extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException{
PrintWriter out =response.getWriter();
java.util.Date today=new java.util.Date();
out.println("<html>"+
"<body>"+
"<h1 align=center>HF's chapter1 Servlet</h1>"
+"<br>"+today+"</body>"+"</html>");
}
} 展开
2013-07-14
展开全部
在WEB-INF/lib目录下有一个servlet-api.jar的包,添加到CLASSPATH里,就OK
2013-07-14
展开全部
j2ee包的classpath没配置好.
找不到j2ee包
找不到j2ee包
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询