Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A servlet that extends HTTPServlet gets access to HTTP header values such as cookies

 
silpa bathina
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A servlet that extends HTTPServlet gets access to HTTP header values such as cookies via what mechanism?
62 A. The getQueryString() method of the HTTPServlet base class A
63 B. The HTTPServletRequest Object B
64 C. HTTP Servlet Response Object C
65 D. There is no mechanism, this must be parsed from the InputStream provided by the base GenericServlet class
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlet programming is easy. Anything you want to know about a client, you get through the request. Anything you want to do to a client, you do through the response. Okay, anything you are ALLOWED to do to the client. You can't slap them across the face with a response object, no matter how much you might want to.

The HttpServletRequest object has a method that allows you to get cookies that have surreptitiously been placed on the client machine.

Cookies are sent to the server in a weird way: not really part of the header, and not as part of a URL. They get sent as a cookie.

Want to place a cookie on the client machine? It's not through the request.

Good luck on the exam! Check out some of my mock quizzes on examscam.com

Cheers!

-Cameron
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic