以下hello为servlet,但在浏览器中运行提交时出现
Status reportmessage /axis/helloworlddescription The requested resource (/axis/helloworld) is not available.代码如下:<form action="helloworld" method="POST" name="form1">
  请输入文件名:
    <label>
    <input type="text" name="textfield" />
    </label>
    <input name="submit" type="submit" value="显示" />
   </form>请问是什么原因?

解决方案 »

  1.   

    servlet很容易碰到路径的问题,你要看下web.xml里怎么配置路径的.改成这样试下action="/你的项目名/helloworld"
      

  2.   

    补充说明一下,我的web.xml里的文件有关设置为以下所示,且这个servlet在浏览器地址栏中能正常运行.
    <servlet>
            <servlet-name>helloworld</servlet-name>
            <servlet-class>mycom.yy.myws.SimpleHello</servlet-class>
    </servlet><servlet-mapping>
            <servlet-name>helloworld</servlet-name>
            <url-pattern>/hello</url-pattern>
    </servlet-mapping>
      

  3.   

    还有就是我的jsp页面文件是放在:"D:\Tomcat5\webapps\axis" 目录下.
      

  4.   

    <servlet-mapping> 
                    <servlet-name> helloworld </servlet-name> 
                    <url-pattern> /hello </url-pattern> 
    </servlet-mapping>
    既然你配置的是/hello,那为什么你访问要用helloworld呢?
      

  5.   

    <form   action="hello"   method="POST"   name="form1"> 
    应该就没问题了。
      

  6.   

    呵呵
    /hello != /helloworld
      

  7.   

    各位,我把它改成:<form       action="hello"       method="POST"       name="form1">   
    如下为出错信息:Status reportmessage HTTP method POST is not supported by this URLdescription The specified HTTP method is not allowed for the requested resource (HTTP method POST is not supported by this URL).
      

  8.   

    action="<%=request.getContextPath()%>/hello"
      

  9.   

    10楼的应该可以了,就是我上面写的action="/你的项目名/helloworld",开始我以为你web.xml里配置的是helloworld.现在把它改成action="/axis/hello"就可以了.
      

  10.   

    <form   action="../helloworld"   method="POST"   name="form1"> 
      

  11.   

    这个问题刚开始我也遇过,web.xml 里定义<servlet-name>   helloworld   </servlet-name>   
                                    <url-pattern>   /hello   </url-pattern>   
    </servlet-mapping> 
    然后在.jsp 里 action="/你的工程文件夹/hello"百分百OK!!
      

  12.   

    碰到这种题不是你的web.xml设置有问题,就是你的jsp里的action路径或servlet里的转向路径没写对。
      

  13.   

    哈哈,感谢各位的帮助,此问题已解决.是我的servlet是只有doGet,没有doPost.