PRJ301 - FE - Part 1 Complete 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?
...
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"); ✔️d
,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
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. ✔️c
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
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) ✔️d
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
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller CertifiedGrades. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $9.49. You're not tied to anything after your purchase.