以下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>请问是什么原因?
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>请问是什么原因?
<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>
<servlet-name> helloworld </servlet-name>
<url-pattern> /hello </url-pattern>
</servlet-mapping>
既然你配置的是/hello,那为什么你访问要用helloworld呢?
应该就没问题了。
/hello != /helloworld
如下为出错信息: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).
<url-pattern> /hello </url-pattern>
</servlet-mapping>
然后在.jsp 里 action="/你的工程文件夹/hello"百分百OK!!