servlet网页不能显示

servlet网页不能显示

我编写的servlet总是显示不了。配置如下:tomcat安装目录下:webapps新建目录sql(里有文件web-inf)web-inf目录下有classes文件夹(里有servlet.class).还有字写得web.xml文件。
servlet.java内容如下:
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class servlet extends HttpServlet{
  private  static final String  content="text/html;charset=gb2312";
  public void init()throws ServletException{
 
  }
  public void doPost(HttpServletRequest  request,HttpServletResponse  respone)
  throws ServletException,IOException{
  doGet(request,respone);
  }
  public void doGet(HttpServletRequest  request,HttpServletResponse  respone)
  throws ServletException,IOException{
 
  respone.setContentType(content);
  PrintWriter out=respone.getWriter();
 
  out.println(" <html>");
  out.println(" <head> <title>用户登录 </title> </head>");
 

  out.println(" <form method =\"post\"  action=\"/servlet\">");
  out.println(" <table>");
 

  out.println(" <tr>");
  out.println(" <td valigin=\"top\">用户名 </td>");
  out.println(" <td valigin=\"top\">");
  out.println("input type=\"text\"  name=\"username\" size=\"20\"");
  out.println(" <td>");
  out.println(" <tr>");
 
 
  out.println(" <tr>");
  out.println(" <td valigin=\"top\">密码 </td>");
  out.println(" <td valigin=\"top\">");
  out.println("input type=\"password\"  name=\"password\" size=\"20\"");
  out.println(" <td>");
  out.println(" <tr>");
 
 
  out.println(" <tr> <td valign=\"top\">");
  out.println("input type=\"submit\"  value=\"登陆\" ");
  out.println(" </td>");
  out.println(" </tr>");
  out.println(" </table>");
  out.println(" </form> </body> </html>");
  out.close(); 
  }
  public void destory(){
 
  } 
}

web.xml如下:
<?xml  version="1.0"  encoding="ISO-8859-1"?> 
  <!DOCTYPE  web-app  PUBLIC  "-//Sun  Microsystems,  Inc.//DTD  Web  Application  2.3//EN"  "http://java.sun.com/dtd/web-app_2_3.dtd"> 
<web-app>

<display-name>Welcome to Tomcat </display-name>
  <description>Welcome to Tomcat </description>
<servlet>
<servlet-name>servlet </servlet-name>
<servlet-class>sql.servlet </servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>servlet </servlet-name>
<url-pattern>/servlet </url-pattern>


</servlet-mapping>


</web-app>
输入 http://localhost:8080/sql/servlet
报错:type Status report

message

description The requested resource () is not available.

怎么回事呢?


<servlet-class>sql.servlet </servlet-class>如果这么写那么你的java文件首先要打包。。建议不要用servlet这类名字。。同时你可以刷一下页面看是否会显示其他错误也可监视一下tomcat里的错误情况。。