Config Implicit Object

Advertisements

Response Implicit Object JSP Page Implicit Onject in JSP

Config Implicit Object

config object is an implicit object of type ServletConfig and it is created by the container, whenever servlet object is created. This object can be used to get initialization parameter for a particular JSP page.

config object is created by the web container for every jsp page. It means if a web application has three jsp pages then three config object are created.

In jsp, it is not mandatory to configure in web.xml. If we configure a JSP in web.xml then the logical name and init parameter given in web.xml file are stored into config object by the container.

config object is accessible, only if the request is given to the jsp by using its url pattern, but not with name of the jsp.

config object is accessible, only if the request is given to the jsp by using its url pattern, but not with name of the jsp.

Example of config implicit object

index.html

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

web.xml file

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

welcome.jsp

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

Response Implicit Object JSP Page Implicit Onject in JSP

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements