Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Submit HTML form Data thru Servlet

 
swati bannore
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Siva Jagadeesan
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Swati:
i think u have to use getParameter("survey").
rgds
Siva
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
neeta h
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic