wood burning stoves 2.0*
The moose likes Servlets and the fly likes Submit HTML form Data thru Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Submit HTML form Data thru Servlet" Watch "Submit HTML form Data thru Servlet" New topic
Author

Submit HTML form Data thru Servlet

swati bannore
Ranch Hand

Joined: Oct 18, 2000
Posts: 201
Hello,
I have a feedback form which receives a input from user.When user "Submits" this data ,it shd be stored in a file.This data storage is done by a Servlet.I ve written a Servlet but getting "Not given a directory to write survey results!"
In my Feedback Form I am passing a value to servlet as follows
<form action="http://128.10.11.120:8001/servlets/SurveyServlet" method=POST>
<input type=hidden name=survey value=Survey01Results>
And I am using getInitParameter.
Somthing somewhere i'm missing.
Can u help me??
thanxx,
Swati

Swati Kale
SCJP
SCWCD
Siva Jagadeesan
Ranch Hand

Joined: Oct 31, 2000
Posts: 160
Dear Swati:
i think u have to use getParameter("survey").
rgds
Siva


Rgds<p>--Siva Jagadeesan<br /><a href="http://java2simple.blog-city.com" target="_blank" rel="nofollow">http://java2simple.blog-city.com</a><br />Sun Certified Java2 Programmer<br />Sun Certified Web Component Developer<br />BEA Certified Weblogic Server 7 Enterprise Developer
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
I believe when a directory is not specifically given, it (assuming you are using servletrunner) tries to write it to a Tmp folder in the default directory. So just create a Tmp folder in your default directory. i.e c:\Tmp in my own case.
Good luck.
Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
neeta h
Greenhorn

Joined: Nov 26, 2000
Posts: 3
hi swati
there is no need to give physical path. u can do it this way
<form method="GET" action="../servlet/servletreq">html form
though directory is servlets use "../servlet/xyz" where xyz is ur servlet class file.
use getParameter() method to acess form fields
hope this will help u.
Neeta
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Submit HTML form Data thru Servlet