Lecture 13 & 14 - Servlets - Advanced Topics Flashcards
Describe state in terms of Servlets?
•HTTP is stateless
–Once a webserver has dealt with a request the connection vanishes
–The server cannot recognize that a sequence of requests is from the same client
What is the solution to avoid the lack of state?
Session Tracking
–Hidden form fields
–URL rewriting
–Cookies
–Sessions
What are cookies?
- Information that a server gives to a client
- On request, the client returns the information
•Used for
–Identifying a user during an e-commerce (or other) session
–Avoiding user-name and password
–Customizing a site
–Focusing advertising
What are the problems with Cookies?
- Some browsers do not support cookies
- Users can disable cookies
- Cookies cannot be larger than 4kb
- Only 20 cookies per domain
- No more than 300 cookies stored at client
- Expiry is up to browser (even though you can specify a value)
Discuss servlets in regards to larger applications?
•Servlets cooperate to create content
•Multiple servlets in a chain
–request parameters supplied to first servlet
–output from each Servlet piped to the next Servlet in the chain
–last servlet in chain sends output to client
•Example use:
–Servlet #1: Translates XSQL page to XML page
–Servlet #2: Translates XML to HTML using XSL