SlideShare a Scribd company logo
Slide 1 of 30
Servlets And ServletContext
Slide 2 of 30
Objectives
 Initialising Servlets
 ServletContext
 RequestDispatcher
 Error Handling in Servlets
 Introduction to Session Tracking
 Session Tracking Techniques
 Session Tracking Using Cookies
 Session Tracking Using HttpSession
 Session Event Handling
Slide 3 of 30
Need for Initialising Servlets
In Web Application, the database connection
information, such as SQL user name and
password are not send to the servlet every time
a client makes a request. Hence, this
information need to be passed tho the servlet
before beginning the servlet life cycle. To pass
the parameter from the client side to the
servlets for executing the first time and retrieve
the data required as specified by the user the
servlet needs to be initialised.
Slide 4 of 30
Interface “ServletConfig”
 To pass as an argument during initialisation.
 The method
– getServletName()
– getInitParameter()
– getServletContext()
Slide 5 of 30
Interface “ServletContext”
 Retrieve and Send information about the server
in which it is running.
 Method of Servlet Context
– getServerInfo()
– getAttribute()
– setAttribute()
Slide 6 of 30
Interface “ServletContextListener”
Implementations of this interface receive
notifications about changes to the servlet
context of the web application they are part of.
To recieve notification events, the
implementation class must be configured in the
deployment descriptor for the web application.
• contextInitialized()
• contextDestroyed()
Slide 7 of 30
ServletContextEvent
This is the event class for notifications about
changes to the servlet context of a web
application.
 getServletContext()
Slide 8 of 30
ServletContextAttributeListener
Implementations of this interface recieve notifications of
changes to the attribute list on the servlet context of a web
application. To recieve notification events, the
implementation class must be configured in the
deployment descriptor for the web application.
• attributeAdded()
• attributeRemoved()
• attributeReplaced()
Slide 9 of 30
ServletContextAttributeEvent
This is the event class for notifications about
changes to the attributes of the servlet context
of a web application.
– getName()
– getValue()
Slide 10 of 30
RequestDispatcher
 Defines an object that receives requests from the client
and sends them to any resource (such as a servlet, HTML
file, or JSP file) on the server. The servlet container creates
the RequestDispatcher object, which is used as a wrapper
around a server resource located at a particular path or
given by a particular name.
 This interface is intended to wrap servlets, but a servlet
container can create RequestDispatcher objects to wrap
any type of resource.
Slide 11 of 30
RequestDispatcher
 Void forward(ServletRequest request, ServletResponse response)
Forwards a request from a servlet to another resource (servlet,
JSP file, or HTML file) on the server.
Slide 12 of 30
RequestDispatcher
 include(ServletRequest request, ServletResponse response)
Includes the content of a resource (servlet, JSP page, HTML file) in the
response.
Slide 13 of 30
Error Handling in Servlet
Slide 14 of 30
Status Code
Slide 15 of 30
Reporting Error(HttpResponse)
 sendError(): Sends an error response to the
client using the specified status.
 setStatus(): Sets the status code for this
response.
Slide 16 of 30
Logging Errors
 Servlet can store the actions and error throught
the log() method of GenericServlet class
Slide 17 of 30
Session
 Is the period of connection between client and server
 Is a group of activities that are performed by a user
while accessing a particular web site
 HTTP is a Stateless protocol
 Http Session are virtual connection between client and
server
17
Slide 18 of 30
Session Tracking
 Allows the server to keep a track of successive requests
made by same client
 Session Tracking Techniques
– Hidden form field
– URL rewriting
– Cookies
– HttpSession interface
18
Slide 19 of 30
Hidden Form Field
 Simplest technique to maintain the state of an end
user.
 Embedded in an HTML form.
 Not visible when you view an HTML file in a browser
window.
– <input type=“hidden” name=“productId” value=“P01”>
19
Slide 20 of 30
URL Rewriting
 Maintains the state of end user by modifying the URL.
 Adds some extra data at the end of the URL
 Is used when the information to be transferred is not
critical.
– <a href=“http://localhost:8080/Books?category=java”> Java
Books </a>
– <form action=“http://localhost:8080//UpdateProfile?
uid=123” method=“get”> ---------- </form>
20
Slide 21 of 30
Cookie
 Is a small piece of information sent by the web
server to the client to keep track of users.
 Cookie has values in the form of key-value pairs
 Types of Cookie
– Temporary Cookie
– Persistent Cookie
 A web browser is expected to support 20 Cookies
per host
 Size of each cookie can be a maximum of 4 KB.
21
Slide 22 of 30
Cookie
Slide 23 of 30
Cookie
– Cookie cookie1 = new Cookie(“CustId”,”123”);
– public void addCookie(cookie1);
– Cookie [] cookies = request.getCookies();
– public String getValue();
– public void setValue(String newValue)
– public String getName()
– public void setMaxAge(int expiry)
– public int getMaxAge()
23
Slide 24 of 30
Working Cookie
 Using HttpResponse
 Using HttpRequest
Slide 25 of 30
HttpSession
– Provides a way to identify a user across more than
one page request or visit to a Web site and to store
information about that user
25
Slide 26 of 30
HttpSession
– request.getSession(boolean create)
– public String getId()
– public Object getAttribute(String name)
– public void setAttribute(String name, Object value)
– public void removeAttribute(String name)
– public long getCreationTime()
– public long getLastAccessedTime()
– public int getMaxInactiveInterval()
– public void setMaxInactiveInterval(int interval)
– public boolean isNew()
– public void invalidate()
26
Slide 27 of 30
HttpSessionAttributeListener
This listener interface can be implemented in order to get
notifications of changes to the attribute lists of sessions
within this web application.
– attributeAdded()
– attributeRemoved()
– attributeReplaced()
Slide 28 of 30
HttpSessionBindingListener
Causes an object to be notified when it is bound to or
unbound from a session. The object is notified by an
HttpSessionBindingEvent object.
– valuedBound()
– valueUnbound()
Slide 29 of 30
HttpSessionBindingEvent
Events of this type are either sent to an object that
implements HttpSessionBindingListener when it is
bound or unbound from a session, or to a
HttpSessionAttributeListener that has been configured
in the deployment descriptor when any attribute is
bound, unbound or replaced in a session.
– getName()
– getSession()
– getValue()
Slide 30 of 30
HttpSessionListener
Implementations of this interface may are notified of
changes to the list of active sessions in a web
application. To recieve notification events, the
implementation class must be configured in the
deployment descriptor for the web application
– sessionCreated()
– sessionDestroyed()
Slide 31 of 30
HttpSessionListener
Slide 32 of 30
HtppSessionActivationListener
Objects that are bound to a session may listen to
container events notifying them that sessions
will be passivated and that session will be
activated.
– sessionDidActive()
– sessionWillPassivate()
Slide 33 of 30
HttpSessionEvent
 This is the class representing event notifications
for changes to sessions within a web
application.
– getSession()
Slide 34 of 30
Summary
34

More Related Content

Viewers also liked

Server Side Event Driven Programming
Server Side Event Driven ProgrammingServer Side Event Driven Programming
Server Side Event Driven Programming
Kamal Hussain
 
Case study event-management_app
Case study event-management_appCase study event-management_app
Case study event-management_app
CDN Mobile Solutions
 
Session 5 : intro to jsp - Giáo trình Bách Khoa Aptech
Session 5 : intro to jsp  - Giáo trình Bách Khoa AptechSession 5 : intro to jsp  - Giáo trình Bách Khoa Aptech
Session 5 : intro to jsp - Giáo trình Bách Khoa Aptech
MasterCode.vn
 
Session 7 : jstl - Giáo trình Bách Khoa Aptech
Session 7 : jstl  - Giáo trình Bách Khoa AptechSession 7 : jstl  - Giáo trình Bách Khoa Aptech
Session 7 : jstl - Giáo trình Bách Khoa Aptech
MasterCode.vn
 
Session 5 : mvc - Giáo trình Bách Khoa Aptech
Session 5 : mvc  - Giáo trình Bách Khoa AptechSession 5 : mvc  - Giáo trình Bách Khoa Aptech
Session 5 : mvc - Giáo trình Bách Khoa Aptech
MasterCode.vn
 
Java/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCJava/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBC
FAKHRUN NISHA
 

Viewers also liked (6)

Server Side Event Driven Programming
Server Side Event Driven ProgrammingServer Side Event Driven Programming
Server Side Event Driven Programming
 
Case study event-management_app
Case study event-management_appCase study event-management_app
Case study event-management_app
 
Session 5 : intro to jsp - Giáo trình Bách Khoa Aptech
Session 5 : intro to jsp  - Giáo trình Bách Khoa AptechSession 5 : intro to jsp  - Giáo trình Bách Khoa Aptech
Session 5 : intro to jsp - Giáo trình Bách Khoa Aptech
 
Session 7 : jstl - Giáo trình Bách Khoa Aptech
Session 7 : jstl  - Giáo trình Bách Khoa AptechSession 7 : jstl  - Giáo trình Bách Khoa Aptech
Session 7 : jstl - Giáo trình Bách Khoa Aptech
 
Session 5 : mvc - Giáo trình Bách Khoa Aptech
Session 5 : mvc  - Giáo trình Bách Khoa AptechSession 5 : mvc  - Giáo trình Bách Khoa Aptech
Session 5 : mvc - Giáo trình Bách Khoa Aptech
 
Java/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCJava/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBC
 

Similar to Session 2 servlet context and session tracking - Giáo trình Bách Khoa Aptech

Working with Servlets
Working with ServletsWorking with Servlets
Working with Servlets
People Strategists
 
Session 1 introduction servlet - Giáo trình Bách Khoa Aptech
Session 1   introduction servlet - Giáo trình Bách Khoa AptechSession 1   introduction servlet - Giáo trình Bách Khoa Aptech
Session 1 introduction servlet - Giáo trình Bách Khoa Aptech
MasterCode.vn
 
Chapter 27 Networking - Deitel & Deitel
Chapter 27 Networking - Deitel & DeitelChapter 27 Networking - Deitel & Deitel
Chapter 27 Networking - Deitel & Deitel
CSDeptSriKaliswariCo
 
Servlets
ServletsServlets
Servlets
Geethu Mohan
 
Servlet ppt by vikas jagtap
Servlet ppt by vikas jagtapServlet ppt by vikas jagtap
Servlet ppt by vikas jagtap
Vikas Jagtap
 
Jsp session tracking
Jsp   session trackingJsp   session tracking
Jsp session tracking
rvarshneyp
 
Web Technologies -- Servlets 4 unit slides
Web Technologies -- Servlets   4 unit slidesWeb Technologies -- Servlets   4 unit slides
Web Technologies -- Servlets 4 unit slides
Sasidhar Kothuru
 
Java servlet life cycle - methods ppt
Java servlet life cycle - methods pptJava servlet life cycle - methods ppt
Java servlet life cycle - methods ppt
kamal kotecha
 
Servlets lecture1
Servlets lecture1Servlets lecture1
Servlets lecture1
Tata Consultancy Services
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
Aren Zomorodian
 
Session 3 inter-servlet communication & filters - Giáo trình Bách Khoa Aptech
Session 3   inter-servlet communication & filters  - Giáo trình Bách Khoa AptechSession 3   inter-servlet communication & filters  - Giáo trình Bách Khoa Aptech
Session 3 inter-servlet communication & filters - Giáo trình Bách Khoa Aptech
MasterCode.vn
 
Advanced #2 networking
Advanced #2   networkingAdvanced #2   networking
Advanced #2 networking
Vitali Pekelis
 
UNIT-3 Servlet
UNIT-3 ServletUNIT-3 Servlet
UNIT-3 Servlet
ssbd6985
 
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R AugeHTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
mfrancis
 
Jasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-casJasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-cas
ellentuck
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
WebStackAcademy
 
Java servlets
Java servletsJava servlets
Java servlets
lopjuan
 
Spring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topicsSpring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topics
Guy Nir
 
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.pptGAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
CUO VEERANAN VEERANAN
 
Unit 38 - Spring MVC Introduction.pptx
Unit 38 - Spring MVC Introduction.pptxUnit 38 - Spring MVC Introduction.pptx
Unit 38 - Spring MVC Introduction.pptx
AbhijayKulshrestha1
 

Similar to Session 2 servlet context and session tracking - Giáo trình Bách Khoa Aptech (20)

Working with Servlets
Working with ServletsWorking with Servlets
Working with Servlets
 
Session 1 introduction servlet - Giáo trình Bách Khoa Aptech
Session 1   introduction servlet - Giáo trình Bách Khoa AptechSession 1   introduction servlet - Giáo trình Bách Khoa Aptech
Session 1 introduction servlet - Giáo trình Bách Khoa Aptech
 
Chapter 27 Networking - Deitel & Deitel
Chapter 27 Networking - Deitel & DeitelChapter 27 Networking - Deitel & Deitel
Chapter 27 Networking - Deitel & Deitel
 
Servlets
ServletsServlets
Servlets
 
Servlet ppt by vikas jagtap
Servlet ppt by vikas jagtapServlet ppt by vikas jagtap
Servlet ppt by vikas jagtap
 
Jsp session tracking
Jsp   session trackingJsp   session tracking
Jsp session tracking
 
Web Technologies -- Servlets 4 unit slides
Web Technologies -- Servlets   4 unit slidesWeb Technologies -- Servlets   4 unit slides
Web Technologies -- Servlets 4 unit slides
 
Java servlet life cycle - methods ppt
Java servlet life cycle - methods pptJava servlet life cycle - methods ppt
Java servlet life cycle - methods ppt
 
Servlets lecture1
Servlets lecture1Servlets lecture1
Servlets lecture1
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
 
Session 3 inter-servlet communication & filters - Giáo trình Bách Khoa Aptech
Session 3   inter-servlet communication & filters  - Giáo trình Bách Khoa AptechSession 3   inter-servlet communication & filters  - Giáo trình Bách Khoa Aptech
Session 3 inter-servlet communication & filters - Giáo trình Bách Khoa Aptech
 
Advanced #2 networking
Advanced #2   networkingAdvanced #2   networking
Advanced #2 networking
 
UNIT-3 Servlet
UNIT-3 ServletUNIT-3 Servlet
UNIT-3 Servlet
 
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R AugeHTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
 
Jasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-casJasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-cas
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 
Java servlets
Java servletsJava servlets
Java servlets
 
Spring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topicsSpring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topics
 
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.pptGAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt
 
Unit 38 - Spring MVC Introduction.pptx
Unit 38 - Spring MVC Introduction.pptxUnit 38 - Spring MVC Introduction.pptx
Unit 38 - Spring MVC Introduction.pptx
 

More from MasterCode.vn

Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vn
Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vnPd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vn
Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vn
MasterCode.vn
 
Why apps-succeed-wpr-mastercode.vn
Why apps-succeed-wpr-mastercode.vnWhy apps-succeed-wpr-mastercode.vn
Why apps-succeed-wpr-mastercode.vn
MasterCode.vn
 
Dzone performancemonitoring2016-mastercode.vn
Dzone performancemonitoring2016-mastercode.vnDzone performancemonitoring2016-mastercode.vn
Dzone performancemonitoring2016-mastercode.vn
MasterCode.vn
 
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vn
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vnGoogle công bố thông tin lịch xu hướng ngành 2017 mastercode.vn
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vn
MasterCode.vn
 
Nghiên cứu về khách hàng mastercode.vn
Nghiên cứu về khách hàng mastercode.vnNghiên cứu về khách hàng mastercode.vn
Nghiên cứu về khách hàng mastercode.vn
MasterCode.vn
 
Lập trình sáng tạo creative computing textbook mastercode.vn
Lập trình sáng tạo creative computing textbook mastercode.vnLập trình sáng tạo creative computing textbook mastercode.vn
Lập trình sáng tạo creative computing textbook mastercode.vn
MasterCode.vn
 
Pd fbuoi7 8--tongquanseo-mastercode.vn
Pd fbuoi7 8--tongquanseo-mastercode.vnPd fbuoi7 8--tongquanseo-mastercode.vn
Pd fbuoi7 8--tongquanseo-mastercode.vn
MasterCode.vn
 
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vn
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vnPd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vn
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vn
MasterCode.vn
 
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vn
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vnPdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vn
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vn
MasterCode.vn
 
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vn
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vnPd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vn
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vn
MasterCode.vn
 
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vn
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vnPd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vn
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vn
MasterCode.vn
 
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vn
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vnPd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vn
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vn
MasterCode.vn
 
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vn
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vnPdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vn
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vn
MasterCode.vn
 
Pdfbài 7 máy tính xác tay và máy in bảo trì sự cố máy tính-mastercode.vn
Pdfbài 7 máy tính xác tay và máy in   bảo trì sự cố máy tính-mastercode.vnPdfbài 7 máy tính xác tay và máy in   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 7 máy tính xác tay và máy in bảo trì sự cố máy tính-mastercode.vn
MasterCode.vn
 
Pdfbài 6 bảo trì máy tính bảo trì sự cố máy tính-mastercode.vn
Pdfbài 6 bảo trì máy tính   bảo trì sự cố máy tính-mastercode.vnPdfbài 6 bảo trì máy tính   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 6 bảo trì máy tính bảo trì sự cố máy tính-mastercode.vn
MasterCode.vn
 
Pdfbài 5 bảo trì và tối ưu windows bảo trì sự cố máy tính-mastercode.vn
Pdfbài 5 bảo trì và tối ưu windows   bảo trì sự cố máy tính-mastercode.vnPdfbài 5 bảo trì và tối ưu windows   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 5 bảo trì và tối ưu windows bảo trì sự cố máy tính-mastercode.vn
MasterCode.vn
 
Pdfbài 4 ổ cứng hard drive bảo trì sự cố máy tính-mastercode.vn
Pdfbài 4 ổ cứng hard drive   bảo trì sự cố máy tính-mastercode.vnPdfbài 4 ổ cứng hard drive   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 4 ổ cứng hard drive bảo trì sự cố máy tính-mastercode.vn
MasterCode.vn
 
Pdfbài 3 cpu và ram bảo trì sự cố máy tính-mastercode.vn
Pdfbài 3 cpu và ram   bảo trì sự cố máy tính-mastercode.vnPdfbài 3 cpu và ram   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 3 cpu và ram bảo trì sự cố máy tính-mastercode.vn
MasterCode.vn
 
Pdfbài 1 giới thiệu chung về phần cứng bảo trì sự cố máy tính-mastercode.vn
Pdfbài 1 giới thiệu chung về phần cứng   bảo trì sự cố máy tính-mastercode.vnPdfbài 1 giới thiệu chung về phần cứng   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 1 giới thiệu chung về phần cứng bảo trì sự cố máy tính-mastercode.vn
MasterCode.vn
 
Pdfbài 2 bo mạch chủ (main) bảo trì sự cố máy tính-mastercode.vn
Pdfbài 2 bo mạch chủ (main)   bảo trì sự cố máy tính-mastercode.vnPdfbài 2 bo mạch chủ (main)   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 2 bo mạch chủ (main) bảo trì sự cố máy tính-mastercode.vn
MasterCode.vn
 

More from MasterCode.vn (20)

Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vn
Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vnPd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vn
Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vn
 
Why apps-succeed-wpr-mastercode.vn
Why apps-succeed-wpr-mastercode.vnWhy apps-succeed-wpr-mastercode.vn
Why apps-succeed-wpr-mastercode.vn
 
Dzone performancemonitoring2016-mastercode.vn
Dzone performancemonitoring2016-mastercode.vnDzone performancemonitoring2016-mastercode.vn
Dzone performancemonitoring2016-mastercode.vn
 
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vn
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vnGoogle công bố thông tin lịch xu hướng ngành 2017 mastercode.vn
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vn
 
Nghiên cứu về khách hàng mastercode.vn
Nghiên cứu về khách hàng mastercode.vnNghiên cứu về khách hàng mastercode.vn
Nghiên cứu về khách hàng mastercode.vn
 
Lập trình sáng tạo creative computing textbook mastercode.vn
Lập trình sáng tạo creative computing textbook mastercode.vnLập trình sáng tạo creative computing textbook mastercode.vn
Lập trình sáng tạo creative computing textbook mastercode.vn
 
Pd fbuoi7 8--tongquanseo-mastercode.vn
Pd fbuoi7 8--tongquanseo-mastercode.vnPd fbuoi7 8--tongquanseo-mastercode.vn
Pd fbuoi7 8--tongquanseo-mastercode.vn
 
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vn
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vnPd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vn
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vn
 
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vn
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vnPdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vn
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vn
 
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vn
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vnPd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vn
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vn
 
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vn
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vnPd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vn
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vn
 
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vn
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vnPd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vn
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vn
 
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vn
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vnPdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vn
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vn
 
Pdfbài 7 máy tính xác tay và máy in bảo trì sự cố máy tính-mastercode.vn
Pdfbài 7 máy tính xác tay và máy in   bảo trì sự cố máy tính-mastercode.vnPdfbài 7 máy tính xác tay và máy in   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 7 máy tính xác tay và máy in bảo trì sự cố máy tính-mastercode.vn
 
Pdfbài 6 bảo trì máy tính bảo trì sự cố máy tính-mastercode.vn
Pdfbài 6 bảo trì máy tính   bảo trì sự cố máy tính-mastercode.vnPdfbài 6 bảo trì máy tính   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 6 bảo trì máy tính bảo trì sự cố máy tính-mastercode.vn
 
Pdfbài 5 bảo trì và tối ưu windows bảo trì sự cố máy tính-mastercode.vn
Pdfbài 5 bảo trì và tối ưu windows   bảo trì sự cố máy tính-mastercode.vnPdfbài 5 bảo trì và tối ưu windows   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 5 bảo trì và tối ưu windows bảo trì sự cố máy tính-mastercode.vn
 
Pdfbài 4 ổ cứng hard drive bảo trì sự cố máy tính-mastercode.vn
Pdfbài 4 ổ cứng hard drive   bảo trì sự cố máy tính-mastercode.vnPdfbài 4 ổ cứng hard drive   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 4 ổ cứng hard drive bảo trì sự cố máy tính-mastercode.vn
 
Pdfbài 3 cpu và ram bảo trì sự cố máy tính-mastercode.vn
Pdfbài 3 cpu và ram   bảo trì sự cố máy tính-mastercode.vnPdfbài 3 cpu và ram   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 3 cpu và ram bảo trì sự cố máy tính-mastercode.vn
 
Pdfbài 1 giới thiệu chung về phần cứng bảo trì sự cố máy tính-mastercode.vn
Pdfbài 1 giới thiệu chung về phần cứng   bảo trì sự cố máy tính-mastercode.vnPdfbài 1 giới thiệu chung về phần cứng   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 1 giới thiệu chung về phần cứng bảo trì sự cố máy tính-mastercode.vn
 
Pdfbài 2 bo mạch chủ (main) bảo trì sự cố máy tính-mastercode.vn
Pdfbài 2 bo mạch chủ (main)   bảo trì sự cố máy tính-mastercode.vnPdfbài 2 bo mạch chủ (main)   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 2 bo mạch chủ (main) bảo trì sự cố máy tính-mastercode.vn
 

Recently uploaded

System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
maazsz111
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 

Recently uploaded (20)

System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 

Session 2 servlet context and session tracking - Giáo trình Bách Khoa Aptech

  • 1. Slide 1 of 30 Servlets And ServletContext
  • 2. Slide 2 of 30 Objectives  Initialising Servlets  ServletContext  RequestDispatcher  Error Handling in Servlets  Introduction to Session Tracking  Session Tracking Techniques  Session Tracking Using Cookies  Session Tracking Using HttpSession  Session Event Handling
  • 3. Slide 3 of 30 Need for Initialising Servlets In Web Application, the database connection information, such as SQL user name and password are not send to the servlet every time a client makes a request. Hence, this information need to be passed tho the servlet before beginning the servlet life cycle. To pass the parameter from the client side to the servlets for executing the first time and retrieve the data required as specified by the user the servlet needs to be initialised.
  • 4. Slide 4 of 30 Interface “ServletConfig”  To pass as an argument during initialisation.  The method – getServletName() – getInitParameter() – getServletContext()
  • 5. Slide 5 of 30 Interface “ServletContext”  Retrieve and Send information about the server in which it is running.  Method of Servlet Context – getServerInfo() – getAttribute() – setAttribute()
  • 6. Slide 6 of 30 Interface “ServletContextListener” Implementations of this interface receive notifications about changes to the servlet context of the web application they are part of. To recieve notification events, the implementation class must be configured in the deployment descriptor for the web application. • contextInitialized() • contextDestroyed()
  • 7. Slide 7 of 30 ServletContextEvent This is the event class for notifications about changes to the servlet context of a web application.  getServletContext()
  • 8. Slide 8 of 30 ServletContextAttributeListener Implementations of this interface recieve notifications of changes to the attribute list on the servlet context of a web application. To recieve notification events, the implementation class must be configured in the deployment descriptor for the web application. • attributeAdded() • attributeRemoved() • attributeReplaced()
  • 9. Slide 9 of 30 ServletContextAttributeEvent This is the event class for notifications about changes to the attributes of the servlet context of a web application. – getName() – getValue()
  • 10. Slide 10 of 30 RequestDispatcher  Defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server. The servlet container creates the RequestDispatcher object, which is used as a wrapper around a server resource located at a particular path or given by a particular name.  This interface is intended to wrap servlets, but a servlet container can create RequestDispatcher objects to wrap any type of resource.
  • 11. Slide 11 of 30 RequestDispatcher  Void forward(ServletRequest request, ServletResponse response) Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server.
  • 12. Slide 12 of 30 RequestDispatcher  include(ServletRequest request, ServletResponse response) Includes the content of a resource (servlet, JSP page, HTML file) in the response.
  • 13. Slide 13 of 30 Error Handling in Servlet
  • 14. Slide 14 of 30 Status Code
  • 15. Slide 15 of 30 Reporting Error(HttpResponse)  sendError(): Sends an error response to the client using the specified status.  setStatus(): Sets the status code for this response.
  • 16. Slide 16 of 30 Logging Errors  Servlet can store the actions and error throught the log() method of GenericServlet class
  • 17. Slide 17 of 30 Session  Is the period of connection between client and server  Is a group of activities that are performed by a user while accessing a particular web site  HTTP is a Stateless protocol  Http Session are virtual connection between client and server 17
  • 18. Slide 18 of 30 Session Tracking  Allows the server to keep a track of successive requests made by same client  Session Tracking Techniques – Hidden form field – URL rewriting – Cookies – HttpSession interface 18
  • 19. Slide 19 of 30 Hidden Form Field  Simplest technique to maintain the state of an end user.  Embedded in an HTML form.  Not visible when you view an HTML file in a browser window. – <input type=“hidden” name=“productId” value=“P01”> 19
  • 20. Slide 20 of 30 URL Rewriting  Maintains the state of end user by modifying the URL.  Adds some extra data at the end of the URL  Is used when the information to be transferred is not critical. – <a href=“http://localhost:8080/Books?category=java”> Java Books </a> – <form action=“http://localhost:8080//UpdateProfile? uid=123” method=“get”> ---------- </form> 20
  • 21. Slide 21 of 30 Cookie  Is a small piece of information sent by the web server to the client to keep track of users.  Cookie has values in the form of key-value pairs  Types of Cookie – Temporary Cookie – Persistent Cookie  A web browser is expected to support 20 Cookies per host  Size of each cookie can be a maximum of 4 KB. 21
  • 22. Slide 22 of 30 Cookie
  • 23. Slide 23 of 30 Cookie – Cookie cookie1 = new Cookie(“CustId”,”123”); – public void addCookie(cookie1); – Cookie [] cookies = request.getCookies(); – public String getValue(); – public void setValue(String newValue) – public String getName() – public void setMaxAge(int expiry) – public int getMaxAge() 23
  • 24. Slide 24 of 30 Working Cookie  Using HttpResponse  Using HttpRequest
  • 25. Slide 25 of 30 HttpSession – Provides a way to identify a user across more than one page request or visit to a Web site and to store information about that user 25
  • 26. Slide 26 of 30 HttpSession – request.getSession(boolean create) – public String getId() – public Object getAttribute(String name) – public void setAttribute(String name, Object value) – public void removeAttribute(String name) – public long getCreationTime() – public long getLastAccessedTime() – public int getMaxInactiveInterval() – public void setMaxInactiveInterval(int interval) – public boolean isNew() – public void invalidate() 26
  • 27. Slide 27 of 30 HttpSessionAttributeListener This listener interface can be implemented in order to get notifications of changes to the attribute lists of sessions within this web application. – attributeAdded() – attributeRemoved() – attributeReplaced()
  • 28. Slide 28 of 30 HttpSessionBindingListener Causes an object to be notified when it is bound to or unbound from a session. The object is notified by an HttpSessionBindingEvent object. – valuedBound() – valueUnbound()
  • 29. Slide 29 of 30 HttpSessionBindingEvent Events of this type are either sent to an object that implements HttpSessionBindingListener when it is bound or unbound from a session, or to a HttpSessionAttributeListener that has been configured in the deployment descriptor when any attribute is bound, unbound or replaced in a session. – getName() – getSession() – getValue()
  • 30. Slide 30 of 30 HttpSessionListener Implementations of this interface may are notified of changes to the list of active sessions in a web application. To recieve notification events, the implementation class must be configured in the deployment descriptor for the web application – sessionCreated() – sessionDestroyed()
  • 31. Slide 31 of 30 HttpSessionListener
  • 32. Slide 32 of 30 HtppSessionActivationListener Objects that are bound to a session may listen to container events notifying them that sessions will be passivated and that session will be activated. – sessionDidActive() – sessionWillPassivate()
  • 33. Slide 33 of 30 HttpSessionEvent  This is the class representing event notifications for changes to sessions within a web application. – getSession()
  • 34. Slide 34 of 30 Summary 34