File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Problem in Mock exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Problem in Mock exam" Watch "Problem in Mock exam" New topic
Author

Problem in Mock exam

Gurukant Desai
Ranch Hand

Joined: Apr 07, 2008
Posts: 56
Hi,

I have a problem in solving a question 2 of Java beat mock simulator.

------------------------------------------------------------------------
2. You need to send large amount of binary data from the browser to a servlet to be processed. (Say, you want to attach a file while sending email through a web based system). What HTTP method would you use?
Select 1 correct option.
A.GET
B.POST
C.HEAD
D.HIDDEN
E.PUT
-------------------------------------------------------------------------
Correct answer given is B. whereas I think answer is E
Reason:- I could get this statement from Mikalai's note that "The PUT
operation allows a client to place a file on the server and is similar to sending a file by FTP." and as data in this case is "large amount of binary data". I think E is better option than B.

Please reply whether I am right/wrong?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41797
    
  62
The PUT method is not supported by browsers (or HTML forms), so that would not work.

It is possible to create PUT requests using the JavaScript XMLHttpRequest object, but JavaScript has no access to the client file system.


Ping & DNS - my free Android networking tools app
Abi Ted
Greenhorn

Joined: May 24, 2008
Posts: 13
I think you are wrong. PUT overwrites target url with the content you send.
The question clearly specifies that the servlet needs to process the content. So the content is POSTed.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in Mock exam