Understanding ServletContext in Java Web Applications

1.3 ServletContext ServletContext represents one of the three main scope objects available in Java web applications. The ServletContext is instantiated when the server starts and destroyed when the server shuts down. Each Java web application contains exactly one ServletContext instance throughout its lifecycle. 1.3.1 ServletContext Overview Th ...

Posted on Tue, 28 Jul 2026 17:12:56 +0000 by teynon

Building Blocks of Java Web Applications: Servlets, Filters, and Listeners

Servlets, filters, and listeners form the backbone of every Java EE web container. Below you’ll find concise explanations, annotated code snippets, and configuration options for each component. Servlet A servlet is a Java class that handles HTTP requests and produces responses. The container manages its life-cycle and maps URLs to servlet insta ...

Posted on Wed, 20 May 2026 16:45:38 +0000 by amcgrath

Managing Client-Side Sessions with HTTP Cookies in Java Servlets

In web development, a session refers to the sequence of interactions between a client (browser) and a server, starting from the moment the browser accesses the site until it is closed. Managing state during these interactions is crucial because the HTTP protocol is stateless. The two primary technologies for session management are Cookies and S ...

Posted on Tue, 19 May 2026 14:51:12 +0000 by FunkyELF