This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes HTTP Status 404 - /onjava/servlet/com.onjava.login Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "HTTP Status 404 - /onjava/servlet/com.onjava.login" Watch "HTTP Status 404 - /onjava/servlet/com.onjava.login" New topic
Author

HTTP Status 404 - /onjava/servlet/com.onjava.login

roy ramos
Greenhorn

Joined: Nov 17, 2009
Posts: 26
Hi there i'm new in java and i was trying to follow some examples that i got also from internet it's how to create login form,
the login.jsp file is working but as soon as i click the submit button it gives me the error

HTTP Status 404 - /onjava/servlet/com.onjava.login

i'm wondering why there is additional directory being called"servlet"

this is how i created the folder in tomcat 6.0


webapps
|
onjava
|
WEB-INF
|
web.xml
lib
classes
|
com
|
onjava
|
login.class

this is the login.jsp file

<html>
<head>
<title>OnJava Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#66CCFF" onLoad="document.loginForm.username.focus()">

<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<form name="loginForm" method="post" action="servlet/com.onjava.login">
<tr>
<td width="401"><div align="right">User Name: </div></td>
<td width="399"><input type="text" name="username"></td>
</tr>
<tr>
<td width="401"><div align="right">Password: </div></td>
<td width="399"><input type="password" name="password"></td>
</tr>
<tr>
<td width="401"> </td>
<td width="399"><br><input type="Submit" name="Submit"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</body>
</html

this it web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app 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"
version="2.4">

<display-name>Login Application</display-name>
<description>
Login Application
</description>

<servlet>
<servlet-name>login</servlet-name>
<servlet-class>com.onjava.login</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>

</web-app>


-roy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 404 - /onjava/servlet/com.onjava.login
 
Similar Threads
Verification failed on Username existence check using AJAX
please any one cleare my error
no error message display for invalid user and password authentication
Resource not found
Struts 2 Tiles