当前位置: 技术问答>java相关
是jdk的问题吗?!急~~~~~~~~~~~~~~~~~~~~~~~
来源: 互联网 发布时间:2015-05-28
本文导语: javac一个HelloWorld.java,代码如下 import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException...
javac一个HelloWorld.java,代码如下
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("");
out.println("");
out.println("");
out.println("Hello World!");
out.println("");
out.println("");
out.println("Hello World!");
out.println("");
out.println("");
}
}
但提示javax.servlet,javax.servlet.http包不存在!!
而tomcat里servlet的例子是运行正常的
请问是什么问题啊?
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("");
out.println("");
out.println("");
out.println("Hello World!");
out.println("");
out.println("");
out.println("Hello World!");
out.println("");
out.println("");
}
}
但提示javax.servlet,javax.servlet.http包不存在!!
而tomcat里servlet的例子是运行正常的
请问是什么问题啊?
|
把servlet包加入到环境变量中去。
|
不是JDK的问题.
servlet包是tomcat自带的.
servlet包是tomcat自带的.