Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Servlet Form POST.

843842Mar 17 2008 — edited Mar 18 2008
I am a newbie for J2EE web development and I am using a remote sharing web server Tomcat 6.1.0 this is my hostname = http://djalmabina.hostsyst.com.
Now i am building an application that sends data from POST form to a servlet, but the server is not finding my class to run it. My web.xml is that :
*
*  
h4. **<?xml*
h4. *version="1.0" encoding="ISO-8859-1"?><!DOCTYPE web-app PUBLIC*
h4. *"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"*
h4. *"http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app*
h4. *xmlns="http://java.sun.com/xml/ns/j2ee"*
h4. *xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"*
h4. *xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee*
h4. *http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">*
h4. *<display-name>Example Applications</display-name>*
h4. *<servlet> <servlet-name>ShowParameters</servlet-name>*
h4. *<servlet-class>djalma.ShowParameters</servlet-class>*
h4. *</servlet> <servlet-mapping>*
h4. *<servlet-name>ShowParameters</servlet-name>*
h4. *<url-pattern>/djalma/*</url-pattern>*
h4. *</servlet-mapping> <session-config>*
h4. *<session-timeout>30</session-timeout>*
h4. *</session-config> <welcome-file-list>*
h4. *<welcome-file>PostForm.html</welcome-file>*
h4. *</welcome-file-list> </web-app>**
h4. *
*
h4. My Posform.html is that :
h4. *<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>A Sample FORM using POST</TITLE> </HEAD> <BODY BGCOLOR="#FDF5E6">* 
h4. *A Sample FORM using POST*
h4.  *<FORM ACTION="djalma/ShowParameters" METHOD="POST"> Item Number: <INPUT TYPE="TEXT" NAME="itemNum">*
h4.  *Quantity: <INPUT TYPE="TEXT" NAME="quantity">*
h4.  *Price Each: <INPUT TYPE="TEXT" NAME="price" VALUE="$">*
h4.  *<HR> First Name: <INPUT TYPE="TEXT" NAME="firstName">*
h4.  *Last Name: <INPUT TYPE="TEXT" NAME="lastName">*
h4.  *Middle Initial: <INPUT TYPE="TEXT" NAME="initial">*
h4.  *Shipping Address: <TEXTAREA NAME="address" ROWS=3 COLS=40></TEXTAREA>*
h4.  *Credit Card:*
h4.  *<INPUT TYPE="RADIO" NAME="cardType" VALUE="Visa">Visa*
h4.  *<INPUT TYPE="RADIO" NAME="cardType" VALUE="Master Card">Master Card*
h4.  *<INPUT TYPE="RADIO" NAME="cardType" VALUE="Amex">American Express*
h4.  *<INPUT TYPE="RADIO" NAME="cardType" VALUE="Discover">Discover*
h4.  *<INPUT TYPE="RADIO" NAME="cardType" VALUE="Java SmartCard">Java SmartCard*
h4.  *Credit Card Number: <INPUT TYPE="PASSWORD" NAME="cardNum">*
h4.  *Repeat Credit Card Number: <INPUT TYPE="PASSWORD" NAME="cardNum">*
*<CENTER> <INPUT TYPE="SUBMIT" VALUE="Submit Order"> </CENTER> </FORM> </BODY> </HTML>*
When I call from browser to show the servlet as
* http://djalmabina.hostsyst.com/form/PostForm.html*
* The server returns the error :*
* Error 404!*
* / form / djalma / ShowParameters*
* File Not Found!*

* My root directory is / htdocs. Please can tell me where is the error. thanks.*
* donovan78.*

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 15 2008
Added on Mar 17 2008
4 comments
137 views