我的Servlet的映射是有的,我只不过没有把它贴出来 现在我把web.xml文件给拷贝过来,让你看看是否错误!谢谢你的回贴!!! ------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <servlet> <description>This is the description of my J2EE component</description> <display-name>This is the display name of my J2EE component</display-name> <servlet-name>ForumServlet</servlet-name> <servlet-class>com.controller.ForumServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>ForumServlet</servlet-name> <url-pattern>/Servlet/ForumServlet</url-pattern> </servlet-mapping> </web-app>
现在我把web.xml文件给拷贝过来,让你看看是否错误!谢谢你的回贴!!!
-------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>ForumServlet</servlet-name>
<servlet-class>com.controller.ForumServlet</servlet-class>
</servlet> <servlet-mapping>
<servlet-name>ForumServlet</servlet-name>
<url-pattern>/Servlet/ForumServlet</url-pattern>
</servlet-mapping>
</web-app>
改为:
<form action="Servlet/ForumServlet" name="PageForm" method="post">
或者把你的web.xml中的
<url-pattern>/Servlet/ForumServlet</url-pattern>
改为:
<url-pattern>/ForumServlet</url-pattern>
web.xml当然是自己写的,绝对不是拷过来的
兄弟别误会,web.xml是我自己写的
你有msn吗,小弟刚学jsp+Servlet不久,在实际开发中有许多不懂的东西还想多多请教!
<form action="/VWebs/Servlet/ForumServlet" name="PageForm" method="post">