aspose 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 39535
    
  27
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 - updated with new look and Ping home screen widget
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
 
Similar Threads
Question from JWebPlus
Clarification needed
Question from JWebPlus
Toughest Questions for Oracle JSP Servlet (SCWCD 5.0) Doubts
Exception