Error running web project in eclipse
Posted
by
DarkKnight
on Stack Overflow
See other posts from Stack Overflow
or by DarkKnight
Published on 2012-11-24T22:59:40Z
Indexed on
2012/11/24
23:03 UTC
Read the original article
Hit count: 208
I am a newbie to servlets. I created a dynamic web project in eclipse. I have following files in my project
home.html validateServlet.java
I have defined validated servlet as an action in home.html form. However when I run it, I get http status 404. Below is the hierarchy of my project
Project
Java Resources
src
com.servlets
ValidateServlet.java
build
WebContent
META-INF
WEB-INF
web.xml
hello.html
Contents of my web.xml are as follows:
<?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>
In my hello.html, action is specified as ,
What might be the issue? I guess I am not able to generate the class file for my servlet. Can anyone guide me through this problem?
© Stack Overflow or respective owner