Java Development Engineer (web direction)-02.Servlet technology-Final Exam

Source: Internet
Author: User
Tags session id

servlet Course Examsservlet Course ExamsServlet Course Exam Scores:55 minTime limit:120 minutesThe answer to the exam has been successfully submitted! Please wait patiently for the results to be announcedservlet Course Exams:1 (12 points)

Talk a little bit about what a servlet you understand, and how the servlet works.

The servlet, the server Applet, is a program that runs on the server side. A Servlet object is actually a Java class.

When the browser communicates with the server, the browser makes a request to the server, which is resolved by the servlet container and sent to the corresponding Servlet object, responds to the request by the Servlet object, and returns the response to the browser.

ref:https://www.zhihu.com/question/21416727

2 (12 points)

Briefly talk about the difference between a cookie and a session, and in the development process, if you need a session hold, how to select the cookie and session

The difference between a cookie and a session is:

Storage location: The cookie is stored on the browser side, the session is stored on the server side;

Security: Cookies are passed in clear text and the session is safer than cookies

Life cycle: The cookie time is calculated from the start of the first visit; The session time is calculated from the date of the last visit; The cookie cannot be actively invalidated, and the session can;

Principle of Use: there is a limit to the number and size of cookies, but the recommended size is not too large.

If session retention is required, it is common to select the session, because security is high, the data is not passed in plaintext, only the session ID is passed, and there is no limit to the size.

ref:https://www.zhihu.com/question/19786827

Java Development Engineer (web direction)-02.Servlet technology-Final Exam

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.