JSP Application Implicit Object


In JSP, the application is an implicit component of the type ServletContext.

The instance of ServletContext is created only one time by the web container when an application or project is deployed on the server.

This object can be used to get the initialization parameter from the configuration file (web.xml). It can also be used to get, set or detach features from the application reach.

This initialization parameter can be made in use by all JSP pages.

Example of application implicit object:


<form action="welcome">  
<input type="text" name="uname">  
<input type="submit" value="go"><br/>  

web.xml file







out.print("Welcome "+request.getParameter("uname"));  
String driver=application.getInitParameter("dname");  
out.print("driver name is="+driver);