• 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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!