1Z0-899 · Question #164
A web application for business expense reporting allows uploading expense receipts. Multiple receipts can be uploaded single step using one HTTP request. The servlet that processes the request has…
The correct answer is A. HttpServletRequest.getParts(). The request.getParts() method returns collections of all Part objects. If you have more than one input of type file, multiple Part objects are returned. Since Part objects are named, the getPart(String name) method can be used to access a particular Part. Alternatively, the…
Question
Options
- AHttpServletRequest.getParts()
- BHttpServletRequest.getData()
- CservletRequest.getParts()
- DservletRequest.getAllParts()
How the community answered
(32 responses)- A78% (25)
- B6% (2)
- C13% (4)
- D3% (1)
Explanation
The request.getParts() method returns collections of all Part objects. If you have more than one input of type file, multiple Part objects are returned. Since Part objects are named, the getPart(String name) method can be used to access a particular Part. Alternatively, the getParts() method, which returns an Iterable<Part>, can be used to get an Iterator over all the Part objects.
Topics
Community Discussion
No community discussion yet for this question.