Skip to main content

ServletContext

Learn ServletContext (Servlet Integration, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes ServletContext represents the whole web application; there is exactly one per application (per container deployment). Shared state : attributes set with setAttribute are visible to every servlet, filter and user, so it works like application scope. Information : it gives the context path, init parameters, resource access with getResourceAsStream and the server info.

More lessons in Servlet Integration