wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes  retrieve the data sent by the FORM 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 » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark " retrieve the data sent by the FORM" Watch " retrieve the data sent by the FORM" New topic
Author

retrieve the data sent by the FORM

dhiru kumar
Greenhorn

Joined: Jul 30, 2011
Posts: 21
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
Bartender

Joined: Apr 07, 2010
Posts: 1627
    
  23

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

Joined: Jul 30, 2011
Posts: 21
Thanks a lot Frits.

Regards
Dhiru
 
Don't get me started about those stupid light bulbs.
 
subject: retrieve the data sent by the FORM
 
Similar Threads
Upload Image to database through Servlet
RequestParameters
doubt from jdiscuss
getParameter
retrieve data from database using jsf