主题:谁会servlet啊
我用eclipse新建一个动态网站工程,主类名是HelloWorld,但在类名上老报错:
The serializable class HelloWorld does not declare a static final
serialVersionUID field of type long
运行时tomcat报错:type Status report
message /test/HelloWorld
description The requested resource (/test/HelloWorld) is not available.
--------------------------------------------------------------------------------
怎么回事啊,谁能告诉我啊,谢谢!!!1[em10]
源码是:
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class for Servlet: HelloWorld
*
*/
public class HelloWorld extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
*/
public HelloWorld() {
super();
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
}
The serializable class HelloWorld does not declare a static final
serialVersionUID field of type long
运行时tomcat报错:type Status report
message /test/HelloWorld
description The requested resource (/test/HelloWorld) is not available.
--------------------------------------------------------------------------------
怎么回事啊,谁能告诉我啊,谢谢!!!1[em10]
源码是:
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class for Servlet: HelloWorld
*
*/
public class HelloWorld extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
*/
public HelloWorld() {
super();
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
}