3

xml ファイルはWebContent/WEB-INF/web.xml私のプロジェクトにあります。私は Eclipse を使用しており、Tomcat を実行しています (これは Eclipse 経由ではインストールされません。個別にインストールすることをお勧めします)。

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>EmployeeManagement</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  <context-param>
    <param-name>name</param-name>
    <param-value>Pramod</param-value>
  </context-param>
  <servlet-mapping>
        <servlet-name>Registration</servlet-name>
        <url-pattern>/EmployeeManagement/WebContent/Registration</url-pattern>
   </servlet-mapping>
</web-app>

フォームページがサーブレットに送信されると機能しません。毎回 404 エラーが発生します。私はしばらくこの問題に遭遇しています。誰か助けてください。

4

6 に答える 6

0

web.xml でサーブレットを定義する別の部分がありません

<servlet>
   <servlet-name>Registration</servlet-name>
   <servlet-class>
      package.path.to.RegistrationServlet
  </servlet-class>
</servlet>
于 2013-09-19T08:34:01.383 に答える
0

フォームのアクションを確認してください。そこに道はあるか

/EmployeeManagement/WebContent/Registration

また

YOURAPPCONTEXT/EmployeeManagement/WebContent/Registration

また

YOURAPPNAME/EmployeeManagement/WebContent/Registration
于 2013-09-19T08:30:06.537 に答える