JSP Implicit Object Overview

JSP provides 9 implicit objects, based on servlet API. These implicit objects are used in JSP pages without writing extra code. These objects are known as standard varaibale.
S.No Implicit Object
1 request
2. response
3 out
4 config
5 pageContex
6 page
7 application
8 session
9 exception
Syntax of JSP page directive
<%@include file="fileName" %>
Attributes of JSP include directive
Only one attribute of include directive is file, and value of file will be relative path.
Example of include directive
index.jsp
<html> <head> <title>Welcome JSP include directive example </title> </head> <body> <form action="login.jsp" method="post"> <fieldset> <legend> <font face="Courier New" size="+1" color="red"> Login </font> </legend> <table> <tr> <td>User Name </td> <td> <input type="text" name="userName"> </td> </tr> <tr> <td>Password </td> <td> <input type="text" name="password"> </td> </tr> <tr> <td colspan=2> <input type="submit" value="Login"> </td> </tr> </table> </fieldset> </form> <%@ include file="footer.jsp" %> </body> </html>
footer.jsp
<%@ page language="java" %> <html> <head> <title>Footer page </title> </head> <body> <div > <p align="center">&nbsp;</p> <p align="center">&nbsp;</p> <p align="center">Copyright © 2010-2012 <a href="http://www.nsstudent.com">nsstudent.com</a></p> <p align="center">Developed And Maintenance By <a href="#">NSSTUDENT TEAM </a> </div> </body> </html>
Output
implict object
Download this example
 



 

Latest Tutorial


Most Visited Tutorial