<?xml version="1.0" encoding="UTF-8"?>
<!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>
<servlet>
<servlet-name>getInfo</servlet-name>
<servlet-class>GetInfo</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>getInfo</servlet-name>
<url-pattern>/getInfo</url-pattern>
</servlet-mapping>
</web-app>*************************************************
action="/getInfo"
<!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>
<servlet>
<servlet-name>getInfo</servlet-name>
<servlet-class>GetInfo</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>getInfo</servlet-name>
<url-pattern>/getInfo</url-pattern>
</servlet-mapping>
</web-app>*************************************************
action="/getInfo"
是这样的其实web.xml 配置是来确定访问方式等问题。
你看看你;用post 提交然后GetInfo.java 只有doGet 方式,所以就资源不让访问了。
在getinfo.java 里面还得有个doPost 别跳楼啊!!!
action的url一定是个正确的
如你的http://192.168.4.112:8080/servlet/GetInfo
别乱配置web.xml
现在这个还不是重点,你该好好学基础的。