Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP protoco  RSS feed

 
Gopala Behara
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
please answer me the following question
A web store must be able to keep track of a customer during each session, but HTTP is a protocol without state. Explain what it means for a protocol to be stateless and describe two ways that the web developer can maintain state

thanks and regards
gopal
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am moving this discussion to Sockets and Internet Protocols forum. Please remember, this forum is for Java Programmer Certification discussions only.
 
Ryan Langley
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If something is stateless, it means that it only worries about performing a specific task and does not keep track of changes made during its task. State and Stateless session beans from the EJB API are good examples of maintaining state. Some objects you will want to keep track of the state (like say a bank account object). Every change someone makes to their bank account will be kept track of (unfortunatley ;-)). Stateless beans are good for when you just need to make a quick calculation of something (like currency rates). A stateless beans job would be to recieve an amount of one currency and change it to the amount of another currency. The bean does not keep track of the currency that gets passed to it. The way to keep state over the web is to identify the specific customer. This is usually done via having the user log-on when he/she comes to the site, or by placing identifying code (a.k.a. a cookie) on the users system when they visit your site. Hope this was what you were looking for! Good luck!
Cheers,
RL
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!