Application Implicit Object

Google Advertisements

Exception Implicit Object in JSP Pagecontext Implicit Object JSP

Application Implicit Object

In JSP, application is an implicit object of type ServletContext. this application object in the Servlet programming is ServletContext.

For all jsp in a web application, there must be a single application object with application object we can share the data from one JSP to any other JSP in the web application.

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

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

Example of Application implicit object

index.html

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

welcome.jsp

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

web.xml

<web-app>  
  
<servlet>  
<servlet-name>One</servlet-name>  
<jsp-file>/welcome.jsp</servlet-class>  
</servlet>  
  
<servlet-mapping>  
<servlet-name>One</servlet-name>  
<url-pattern>/welcome</url-pattern>  
</servlet-mapping>  
  
<context-param>  
<param-name>dname</param-name>  
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>  
</context-param>  
 
</web-app> 

Exception Implicit Object in JSP Pagecontext Implicit Object JSP

Google Advertisements

We have more than 5 Groups which have 500000+ Members and some Pages have more than 100000+ members. For Advertisement contact on [email protected] or 8076671483

Buy This Ad Space @$50 per Month, Ad Size 600X200 Contact on: [email protected] or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Classpath variable is set for providing a path for predefined Java classes which is used in our application. All classes are available in lib/rt.jar so we set classpath upto lib/rt.jar. Difference between path and classpath in Java

Cloud computing is the on demand availability of computer system resources, especially data storage and computing power, without direct active management by the user. Cloud Computing Tutorial

College Projects Related to Java, AWT, C Projects for College, C++ Projects for College, Android Projects. Download Java C C++ Projects

Download Projects

Adsense Advertisements


Buy This ads Space 8076671483

Buy This Ad Space @$120 per Month, Ad Size 300X600 Contact on: [email protected] or 8076671483 Try this Keyword C++ Programs