Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 15 pages
Exam (elaborations)

PRJ321 || with Complete Solutions.

Document preview thumbnail
Preview 2 out of 15 pages

PRJ321 || with Complete Solutions.

Content preview

PRJ321 || with Complete Solutions.
b correct answers Consider the following HTML page code:
<html><body>
<a href="/servlet/HelloServlet">POST</a>
</body></html>

Which method of HelloServlet will be invoked when the hyperlink displayed by the above
page is clicked?
Choose one answer.
a. doPost
b. doGet
c. doHref
d. doForm
e. serviceGet

d correct answers Consider the following HTML page code:
<html><body>
<form name="data" action="/servlet/DataServlet" method="POST">
<input type="text" name="name">
<input type="submit" name="submit">
</form>
</body></html>
Identify the TWO methods that can be used to retrieve the value of the name parameter when
the form is submitted.
Choose one answer.
a. getParameters("name");
b. getParameterValue("name");
c. getValue("name");
d. getParameter("name");

c correct answers Which method in the HttpServlet class services the HTTP POST request?
Choose one answer.
a. doPOST(HttpServletRequest, HttpServletResponse)
b. servicePost(HttpServletRequest, HttpServletResponse)
c. doPost(HttpServletRequest, HttpServletResponse)
d. doPost(ServletRequest, ServletResponse)
e. doPOST(ServletRequest, ServletResponse)

c correct answers The HttpServletResponse lets you:
Choose one answer.
a. specify response headers (Content-Type, Set-Cookie, etc.)
b. specify outgoing information such as HTTP status codes (200, 404, etc.)
c. All of the others.
d. obtain a PrintWriter used to send the document content back to the client.

d correct answers The HttpServletRequest has methods by which you can find out about
incoming information such as:
Choose one answer.
a. form data

, b. HTTP request headers
c. the client's hostname
d. All of the others.
e. cookies

d correct answers Which of the following methods can be used to add cookies to a servlet
response?
Choose one answer.
a. ServletResponse.addCookie(String contents)
b. HttpServletResponse.addCookie(String contents)
c. ServletResponse.addHeader(String name, String value)
d. HttpServletResponse.addCookie(Cookie cookie)
e. ServletResponse.addCookie(Cookie cookie)

c correct answers Consider the following declarations:

1.

GET http://cms.fpt.edu.vn/index.jsp HTTP/1.1

Accept: image/*, application/vnd.txt

Accept-Language: en-cd

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0)

Host: www.fpt.edu.vn

2.

HTTP/1.0 404 File Not Found

Connection: Close

Date: Sat, 07 Aug 2010 08:30:30 GMT

Content-Type: text/html

Server: J2EE/ 2.0

Which of the following statements is true?

Choose one answer.
a. The first fragment text describes the HTTP Response
b. None of the other choices
c. The first fragment text describes the HTTP Request
d. The second fragment text describes the HTTP Request

d correct answers Consider the following code statement:

Document information

Uploaded on
November 26, 2025
Number of pages
15
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$15.79

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
SirAnton
3.7
(118)
Sold
789
Followers
438
Items
39711
Last sold
13 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions