你先把原先编译运行的程序关掉,在重新运行试试。因为Tomcat有时需要重新启动。

解决方案 »

  1.   

    package servlet;import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import com.borland.internetbeans.*;public class MyServlet extends HttpServlet {
      private static final String CONTENT_TYPE = "text/html; charset=GBK";
      MyDataModule myDataModule1;
      IxPageProducer ixPageProducer1 = new IxPageProducer();
      //Initialize global variables
      public void init() throws ServletException {
      }
      //Process the HTTP Get request
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType(CONTENT_TYPE);
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<head><title>MyServlet</title></head>");
        out.println("<body>");
        out.println("<p>The servlet has received a GET.This is the reply.&nbsp THE name is");
        String name=request.getParameter("name");
        out.println(name);
        out.println(". This a reply.</p>");
        out.println("</body></html>");  }
      //Process the HTTP Post request
      public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType(CONTENT_TYPE);
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<head><title>MyServlet</title></head>");
        out.println("<body>");
        out.println("<p>The servlet has received a GET.This is the reply.&nbsp THE name is");
        String name=request.getParameter("name");
        out.println(name);
        out.println(". This a reply.</p>");
        out.println("</body></html>");
      }
      //Clean up resources
      public void destroy() {
      }  public MyServlet() {
        try {
          jbInit();
        }
        catch(Exception e) {
          e.printStackTrace();
        }
      }
      private void jbInit() throws Exception {
        myDataModule1 = servlet.MyDataModule.getDataModule();
        ixPageProducer1.setDataModule(myDataModule1);
      }
    }
    -----------------------------------
    <html>
    <head>
    <title>Hello HTML</title>
    </head>
    <body>
    <u>Hello my baby</u>
    <form name="MyFrom" method="post" action="http://localhost:8080/WepAppication/MyServlet">
    <table>
    <tr><td>请输入你的名字:</td><td><input name="name" type="text" ></td></tr>
    </table>
    </form>
    </body>
    </html>
      

  2.   

    java.lang.IllegalStateException: Can't happen - classname is null, who added this ?----------------好像是没找到类文件<form name="MyFrom" method="post" action="http://localhost:8080/WepAppication/MyServlet">
    -------------action属性用的有问题
    改成action="http://localhost:8080/servlet/MyServlet"试试。
      

  3.   

    import com.borland.internetbeans.*;
    找不到你调用的这个包。
      

  4.   

    先不谈htm文件出错
    最重要的是MySevlet出错。
    按提示好像是找不到数据源,我的程序是不是哪里没有定义好数据的源的路径
    或者访问的方法
      

  5.   

    这个错误是TOMCAT没有找到你的servlet。你这个MyServlet在wepAppication目录下吗?
      

  6.   

    com.borland.internetbeans.* 没有在你的classpath里,
    你的另外一个类MyDataModule
    里面引用了com.borland.dx.dataset.DataModule
    而这个包也没有在classpath里,
    在jbuilder里加进去就可以了。
      

  7.   

    能不那告诉怎么把这个包加进去。我接触jbuilder才三天