Question
How does Cookies work in Servlets

Answers

Cookies are used a lot in web client-server communication, it’s not something specific to java. Cookies are text data sent by server to the client and it gets saved at the client local machine.

Servlet API provides cookies support through javax.servlet.http.Cookie class that implements Serializable and Cloneable interfaces.

HttpServletRequest getCookies() method is provided to get the array of Cookies from request, since there is no point of adding Cookie to request, there are no methods to set or add cookie to request.

Similarly HttpServletResponse addCookie(Cookie c) method is provided to attach cookie in response header, there are no getter methods for cookie.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q The private sector bank which has become the first bank in India to launch Watch Banking for Apple Watch ?
  • Q Define buoyancy in brief?
  • Q Joint sittings of two houses of the parliament are presided over by:
  • Q Who was the British Viceroy at the time of the formation of Indian National Congress?
  • Q what is the file extension for object in AUT captured by WR
  • Q How to change a VISUAL ATTRIBUTE dynamically ?
  • Q To kill someone by covering their nose and mouth so that they suffocate
  • Q How many moons do Mars planets have
  • Q The ratio for Boys to Girls is 6:4. 60% of the boys and 40% of girls take lunch in the canteen. What % of class takes lunch in canteen.
  • Q Who links a western gambler and a private eye
  • Q Give the parameters of the dbms_job.submit procedure ?