JSP Implicit Objects List

The JSP implicit objects are the Java objects that the JSP Container makes available to the developers in each page and the developer can call them directly without being explicitly declared. JSP Implicit Objects are also called pre-defined variables.

There is a total of 9 implicit objects available in JSP.
All JSP Examples at JSP Source Code Examples

Implicit Objects and their Types

Implicit ObjectType
requestjavax.servlet.http.HttpServletRequest
responsejavax.servlet.http.HttpServletResponse
pageContextjavax.servlet.jsp.PageContext
sessionjavax.servlet.http.HttpSession
applicationjavax.servlet.ServletContext
outjavax.servlet.jsp.JspWriter
configjavax.servlet.ServletConfig
pagejava.lang.Object
exceptionjavax.servlet.jsp.JspException

Implicit Objects in JSP Page

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" isErrorPage="true" %>
    
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
    <%= request %>
 
    <%= response %>
 
    <%= pageContext %> 
 
    <%= session %> 
 
    <%= application %> 
 
    <%= out %>
  
    <%= config %> 
 
    <%= page %> 
 
    <%= exception %>
 
</body>
</html>
Read more about JSP implicit objects at https://www.javaguides.net/2019/01/jsp-implicit-objects.html.

All JSP Examples at JSP Source Code Examples


Comments