Εξέταση 2ης εργασίας 
• Παρακαλώ οι παρακάτω να παραμείνουν την 2η ώρα για να 
συζητήσουμε την εργασία τους 
546(alkis), 593 (antonis), 917(thodoros), 935, 941, 
959(sotiri), 989, 996(alexandros), 1502(evi), 1557
3η εργασία 
Μελετήστε το 5ο κεφάλαιο του βιβλίου Head First Servlets & JSP, 
Second Edition, και προσπαθήστε τις ερωτήσεις της εξέτασης. 
Χρησιμοποιήστε τον σύνδεσμο http://www.datadisk.co.uk/html_docs/ 
jsp/jsp_mvc_tutorial.htm για να υλοποιήσετε μια web application η 
οποία θα μας βοηθάει να επιλέξουμε το είδος του καφέ που 
επιθυμούμε. 
Καταθέστε την εργασία σας πριν τις 08.00 της Δευτέρας 27 
Οκτωβρίου συμπληρώνοντας την παρακάτω φόρμα.
Εργασία εξαμήνου 
Δώστε τις προτάσεις σας και συζητήστε τες μαζί μου.
Conversational State 
Chapter 6
Conversational state 
• Web servers have no short-term memory. As soon as they close 
connection to your session they forget you. 
• Most of the time this is what you need 
• Sometimes you do need to keep the conversation with the container 
alive for awhile. 
• Keep client specific state across multiple requests
Implement 
• Use a stateful session enterprise javabean 
• Use a database 
• Use an HttpSession
How 
Sessions 
Work
Clients & Sessions 
• HTTP is stateless 
• HTTPS is not but it is heavy in many respects 
• Unique IP is not enough
Unique Session ID
Cookies
Let the container do most 
Get or set 
HttpSession session = request.getsession();
Existing or not?
Pre-existing session?
URL re-writing
URL re-writing only after encoding
Summary for get.Session() 
I want a session for THIS client 
A session that matches the session ID sent or 
A new session 
The session is with the client associated with the request
You need to do some killing
Killing Sessions 
• Authority 
to 
kill 
– Container 
– You 
• Ways 
to 
kill 
– timeout 
– invalidate() 
– crash
All 
sessions 
Only 
the 
session 
you 
call 
from 
Death by timeout
Using Cookies 
• Cookies 
are 
sweet 
because 
the 
container 
takes 
care 
of 
during 
a 
session. 
• You 
may 
keep 
a 
cookie 
across 
sessions 
too.
Using Cookies with Servlet API 
No 
getCookie(String)
Example 
(SET 
& 
send)
Example 
(GET)
Cookies 
are 
not 
Headers!
Milestones
Session on different VMs 
Session 
is 
not 
duplicated
Session 
Migration
Session 
related 
Listeners
Listeners 
& 
API

More Related Content

PDF
1η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
PDF
2η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
PDF
Frontend Optimizations (Greek)
PDF
Ch. 7 beeing a jsp
PDF
Ch5 beeing an application
PDF
Being a jsp
PDF
Ch. 8 script free pages
PDF
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
1η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
2η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
Frontend Optimizations (Greek)
Ch. 7 beeing a jsp
Ch5 beeing an application
Being a jsp
Ch. 8 script free pages
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού

Viewers also liked (8)

PDF
3η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
PDF
Ch. x web performance
PDF
Ch. 12 security
PDF
Ch. 9 jsp standard tag library
PDF
Ch. 13 filters and wrappers
PDF
Ch. 10 custom tag development
PDF
Ch. 11 deploying
PDF
Study: The Future of VR, AR and Self-Driving Cars
3η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
Ch. x web performance
Ch. 12 security
Ch. 9 jsp standard tag library
Ch. 13 filters and wrappers
Ch. 10 custom tag development
Ch. 11 deploying
Study: The Future of VR, AR and Self-Driving Cars
Ad

Ch6 conversational state