• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retrieve the data sent by the FORM

 
dhiru kumar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

This is the question from enthuware Practice test 1 question 26
How can you retrieve the data sent by the FORM displayed by following HTML page code?


Given answer are
request.getInputStream();
request.getReader();

why can't it be
request.getParameter("name");
I could not understand the explanation given.

Thanks
Dhiru

 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2536
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dhiru

why can't it be request.getParameter("name");

<input type="file"> means that you are submitting a file, and not a single input field containing a String

from the API:
request.getInputStream() - Retrieves the body of the request as binary data using a ServletInputStream
request.getReader() - Retrieves the body of the request as character data using a BufferedReader. The reader translates the character data according to the character encoding used on the body

Regards,
Frits
 
dhiru kumar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Frits.

Regards
Dhiru
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic