| < Free Open Study > |
|
In this chapter, we've covered one of the most important features of the Java Servlet API. The session handling interfaces of this API allow you to not only track users across requests by establishing sessions, but they also allow you to maintain state for each session. We saw that the default mechanism used by the API to maintain sessions was to use cookies, but we noted that it is capable of using the URL rewriting mechanism instead, in the case where cookie creation was not permitted by the client.
We built a comprehensive example web application that demonstrated the use of the session handling interfaces and classes, and we saw how we could use event listener classes to notify the application when changes to the Session object occur.
We also saw that while session handling features are useful for storing information in memory, there are associated risks with doing so - particularly in production environments. These risks include loss of performance and reliability. Both of these issues can be addressed by carefully considering which attributes we should add to a session, and for how long we need to keep them in the session.
In the next chapter we will investigate the ways in which we can persist data from our servlets.
A |
---|
Activation
attributeAdded() method,
attributeRemoved() method,
attributeReplaced() method,
|
C |
---|
classes
clusters
Cookie class, javax.servlet.http
cookies
|
D |
---|
data
database schema
deployment descriptor
|
E |
---|
EditNoteServlet
elements
e-mail logging class, 39 |
F |
---|
fail-over considerations, 43 form fields, hidden
|
G |
---|
getAttribute() method, HttpSession interface
getAttributeNames() method, HttpSession interface
getCreationTime() method, HttpSession interface
getId() method, HttpSession interface
getLastAccessedTime() method, HttpSession interface
getMaxInactiveInterval() method, HttpSession interface
getName() method, HttpSessionBindingEvent class
getServletContext() method, HttpSession interface
getSession() method, HttpSession interface
getSession() method, HttpSessionBindingEvent class
getSession() method, HttpSessionEvent class
getSession() method, HttpSessionListener interface
getValue() method, HttpSessionBindingEvent class
|
H |
---|
hidden form fields
HTTP (Hypertext Transfer Protocol)
HttpServletRequest class, javax.servlet.http
HttpServletResponse class, javax.servlet.http
HTTPSession interface
HttpSession interface, javax.servlet.http
HttpSessionActivationListener class, javax.servlet.http
HttpSessionActivationListener interface, javax.servlet.http
HttpSessionAttributeListener class, javax.servlet.http
HttpSessionAttributeListener interface, javax.servlet.http
HttpSessionBindingEvent class, javax.servlet.http
HttpSessionBindingListener interface, javax.servlet.http
HttpSessionEvent class, javax.servlet.http
HttpSessionListener interface, javax.servlet.http
|
I |
---|
interfaces
invalidate() method, HttpSession interface
isNew() method, HttpSession interface
|
K |
---|
keep-alive, HTTP 1.1, 2 |
L |
---|
listener> element
listener-class> element
ListNotesServlet
log() method, HttpSessionAttributeListener interface
|
M |
---|
methods
MySQL
|
N |
---|
NotePad application
|
P |
---|
passivation
|
R |
---|
references to web sites
removeAttribute() method, HttpSession interface session management, 18 replication
resource-ref> element
|
S |
---|
serialization
Servlet 2.3 API
servlet> element
servlet-mapping> element
servlets
session handling, 1
session inactivity
session lifecycle events
session lifetime
session listener
session logging class, 38 session management
session see sessions/session management. session state
session tracking
sessionCreated() method, HttpSessionListener interface
sessionDestroyed() method, HttpSessionListener interface
sessionDidActivate() method,
sessions/session management
sessionWillPassivate() method,
setAttribute() method, HttpSession interface
setMaxInactiveInterval() method, HttpSession interface
setMaxInactiveInterval() method, Session object
SSL (Secure Sockets Layer)
state
state see session state. |
U |
---|
URL rewriting
|
V |
---|
valueBound() method, HttpSessionBindingListener interface
valueUnbound() method,
|
W |
---|
welcome pages
|
| < Free Open Study > |
|