How to get ServletContext in Servlet, jsp, spring controller or struts action class is common need of any Java web developer. As ServletContext is an application wide object and used to store variables in global scope, getting a reference of ServletContext is pretty important. Every web application can have only one ServletContext though they can have multiple ServletConfig object. In this article we will see :
Read more »
How to get Servlet Context inside Spring MVC Controller?
How to find Servlet Context inside Struts Action class?
How to get Servlet Context inside JSP File?
How to find Servlet Context inside HttpServlet Class?