File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "form data" Watch "form data" New topic

form data

trinadh reddy
Ranch Hand

Joined: Sep 22, 2005
Posts: 60
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.
I agree. Here's the link:
subject: form data
It's not a secret anymore!