jQuery in Action, 2nd edition*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 1662
    
  25

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: retrieve the data sent by the FORM