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 Servlets and the fly likes form data 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 » Java » Servlets
Bookmark "form data" Watch "form data" New topic

form data

trinadh reddy
Ranch Hand

Joined: Sep 22, 2005
Posts: 58
I have a sample html form . i have written a servlet to retreive data from the form. but 404 error is comming.please see this


servlet program


please see this as iam unable to understand where is the problem

[ EDIT - Code tags added by Dave]
[ October 11, 2005: Message edited by: David O'Meara ]
Sudhakar Gaharwar

Joined: Oct 10, 2005
Posts: 15
hi Reddy,
Everything is looking fine ..Try to do one thing give complete path in html file. I mean to say in case of using <FORM action=./showParam> just use complete path..Reply me soon
[ October 11, 2005: Message edited by: Sudhakar Gaharwar ]
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
In the Form Element remove the dot and slash and letter "p" should be in small case. It should be the same as the url-pattern element.

[ October 11, 2005: Message edited by: vishnu prakash ]

Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
You might need to code the context path into the form action attribute because the browser will not interpret your action value as relative to your context, instead the browser will interpret it to the root of your web server.

You might wanna use <c:url> action in JSTL to handle this issue for you.

SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="" target="_blank" rel="nofollow"></a>
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Please use code tags when posting code.
It is sorta covered in the JavaRanch Style Guide.
subject: form data
Similar Threads
Create servlet to display results set
Problem:The requested resource (/ShowParameters) is not available
HTTP POST-Method not supported by this URL.
how to declare....and pass parameters..