<form action="/sevlet/SomeServlet" method="Get">好象就OK了

解决方案 »

  1.   

    你的Servlet还没有每调用呢!Servlet是需要触发的,浏览器下载index.html后不会自动执行你的Servlet.改改的你的html文件,比如:
     <Html>
    <head>
    <Title>示列表单</Title>
    </head>
    <body bgcolor="#FDF5E6">
    <a href="/sevlet/SomeServlet">用Post方法发送数据的表单</a>
    </Form>
    </body>
    </html>
     点击超链就会调用你Servlet的doGet()方法了!
      

  2.   


    type Status reportmessage /sevlet/SomeServletdescription The requested resource (/sevlet/SomeServlet) is not available.
    关键是找不到servlet为什么呢?
      

  3.   

    再详细说明一下你把 servlet 存在什么目录下。
      

  4.   

    我把servlet存在TOmcat的root的自建的servlet的目录下
      

  5.   

    注意你的程序
    public void doGet(HttpServletRequest request,HttpServletResponse response) 
            throws ServletException,IOException{
            PrintWriter out = response.getWriter();
            out.println("hello world");
            }
    你只实现了doGet方法,所以用post时不行,解决的方法
    1、在你的表单里,设为method=get
    2、加一个方法
    public void doPost(HttpServletRequest request,HttpServletResponse response) 
            throws ServletException,IOException{
                doGet(request,response); 
            }
    祝你好运。
      

  6.   

    另外,你的表单必须要提交到那个servlet去阿
    修改你的HTML文件如下
    <form action="/sevlet/SomeServlet" method="Post">
    <input type=submit value='提交'>
    </Form>
      

  7.   

    好大的风:
      程序的改动,我已经进行了修改,但是,我现在觉得是路径的问题。
      我的servlet不在classpath的目录下面吧,我的服务器是NT4,但是,我
    不知如何设置classpath环境变量呢?
      

  8.   

    上面的朋友你好:
     你的问题搞定了没有,我也碰到了此类问题,请指叫,谢谢!!!!
     [email protected]