我是 servlet 的新手。我在 Eclipse 中创建了一个动态 Web 项目。我的项目中有以下文件
home.html validateServlet.java
我已将经过验证的 servlet 定义为 home.html 表单中的操作。但是,当我运行它时,我得到 http 状态 404。下面是我的项目的层次结构
Project
Java Resources
src
com.servlets
ValidateServlet.java
build
WebContent
META-INF
WEB-INF
web.xml
hello.html
我的 web.xml 的内容如下:
<?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" xmlns:web="http://java.sun.com/xml/ns/javaee/web- app_2_5.xsd" 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>Website</display-name>
<servlet>
<description></description>
<display-name>ValidateServlet</display-name>
<servlet-name>validate</servlet-name>
<servlet-class>com.oracle.coen235.servlets.ValidateServlet</servlet-class>
</servlet>
</web-app>
在我的 hello.html 中,动作被指定为
可能是什么问题?我想我无法为我的 servlet 生成类文件。谁能指导我解决这个问题?