JSP programming Technology 5-Shopping Cart implementation-session Session Object

Source: Internet
Author: User

First of all, thank you very much for my support of the article, I am a just to find their own direction of the university students, of course, my knowledge and ability is limited, is now trying to learn from the bad. When I saw myself first published to CSDN home page of the article only a few hours to read more than 100, for me is undoubtedly a great encouragement, I am flattered that I was really moved, thank you very much for my support. In any case, we are all standing on the shoulders of giants to get everything. In the social competition is so fierce today, especially the rapid development of it, we need to learn a lot of things every day to keep up with the rhythm of the society, my idea is to grasp the real thing through the text of the way to show to everyone, want to put a lot of other useful things to share to everyone.

Of course, in the article I just tell everyone what I think. If you have any good methods or set up, welcome to add friends or comments or messages pointed out. Start today. I was determined to step into the IT sector, I would like to ask you predecessors a lot of comments, this process I know very hard. But I'm going to keep trying.

。。

Here are my own shopping cart Demo sample, using the JSP built-in session object, in the client and server implementation of a conversation, the last case I also said, after the client and the server link until the logoff, the session object has always existed.

First set up a client page, I do very easy, the purpose of hope that everyone first to clear this process, it is important that the idea, the code related to the position I also joined the gaze.

The next step is to display the shopping cart page, and when the client clicks on "Show cart", the server response returns to the page showing the current shopping cart information. The session object is always present throughout the process.

Well, a complete shopping cart is realized.

To summarize: First we need to establish the client and the server link (here I have connected, the connection method see the previous article) has produced the session object. The session always exists only if the client and server are constantly connected. Otherwise a lot of clients in the case of the server how to identify who is still connected or who offline, are through the Session object implementation.

The server then retrieves the information submitted by the client and runs the corresponding JSP program (that is, identifying what the client has bought). Finally, when the client clicks on "Show cart". The server returns to the shopping cart page. Shows which books the client is currently purchasing.

I hope you understand this process, the process of understanding, for future web development is very helpful, we have a lot of things are built on the session object. Please comment or leave a message if you have any questions.

JSP programming Technology 5-Shopping Cart implementation-session Session Object

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.