JSP EL Implicit Objects

Apart from operators, JSP also provide expression language implicit objects. The role of these implicit objects is to get the attribute associated with various object. Here, is the list of expression language implicit objects with their purposes.

Implicit Object

                               Description

requestScope

Fetches the attribute associated with request object.

sessionScope

Fetches the attribute associated with session object.

pageScope

It provides the attribute associate within pageScope.

applicationScope

Fetches the attribute associated with application object.

param

It retrieves the single value associated with request parameter.

paramValues

It retrieves the array of values associated with request parameter.

header

It retrieves the single value associated with header parameter.

headerValues

It retrieves the array of values associated with header parameter.

cookie

It is used to get the value of cookies.

initParam

It is used to map an initialize parameter.

pageContext

The role of this object is similar to JSP pageContext implicit object.

Example of Expression Language Implicit Object

This example shows the way of using various expression language implicit objects.

index.jsp



<% request.setAttribute("Tutorial", "Java"); application.setAttribute("Tutorial", "Python"); request.getSession().setAttribute("Tutorial", "PHP"); %>
Host name: ${header["host"]}
Path name: ${pageContext.request.contextPath}
Tutorials:
${requestScope.Tutorial}
${applicationScope.Tutorial}
${sessionScope.Tutorial}

Output:


Related Topics

JSP application

JSP application object is an instance of servlet's ServletContext interface. It is used initialize parameter of one or more JSP pages in an application. Thus, the scope of application object...

1 minute read.

JSP Expression Tag

JSP expression tag allows you to place the result of Java expression in a convenient way. It can be seen as an alternative of out.print() method. Thus, if we want to...

1 minute read.

JSP Cookie Handling

Cookie is a small piece of information sent by server to recognize the user. This information is stored at client side in the textual form. In JSP, cookie is an object...

1 minute read.

JSP response

Basically, JSP response object is an instance of servlet's HttpServletResponse interface. It is used to resolve client request. Response object can be used to perform various functions such as encode...

1 minute read.

JSP session

In JSP, session object is used to establish a connection between a client and a server. It maintains the state between them so that server recognize the user easily. The session...

1 minute read.

JSP Taglib Directive

Taglib directive is used to define tag libraries in JSP page. It enables user to use custom tags within JSP file. A JSP page can contains more than one taglib...

1 minute read.

JSP Expression Language

JSP introduced the concept of expression language (EL) in JSP 2.0 version. The purpose of expression language is to access and manipulate data easily without using any type of scriptlet. Why...

1 minute read.

JSP Page Directive

JSP page directive provides various attributes with unique properties. These attributes can be applied to an entire JSP page. The syntax of Page directive is as follows: - <@page attribute="value"> Page directive...

3 minutes read.

JSP Life Cycle

JSP life cycle The life cycle of JSP page internally implemented as a Servlet. These are the following stages through which a JSP page has to pass: Translation – This is an...

2 minutes read.

JSP Directives

In JSP, the role of directive is to provide directions to the JSP container regarding the compilation of JSP page. Directives convey information from JSP page to container that give...

1 minute read.

JSP exception

Like Java, exceptions can also be occurred in JSP. To handle these exceptions, JSP exception object is used. Handling exceptions in JSP using exception object is much easier approach. This...

1 minute read.

JSTL Function Tags

In JSTL, the purpose of function tags is similar to the various string methods in Java. Hence, these tag performs common string manipulation operations. Functional tag is represented by following URL:...

2 minutes read.

JSTL Formatting Tags

In JSTL, the role of formatting tag is to specify the type of format that represents date and time. The following syntax represent the URL of formatting tag: - <%@ taglib...

1 minute read.

JSP Request

The request object is used to fetch the user's data from the browser and pass this data to the server. The working of JSP request object is similar to the...

1 minute read.

JSP Implicit Objects

In JSP, implicit objects are pre-defined objects, created by the web container. These objects are created during the translation phase from JSP to Servlet. JSP allows you to call these...

1 minute read.

JSTL XML Tags

In JSTL, XML tags are used for creating and manipulating xml documents. The following syntax represent the URL of XML tag: - <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %> To utilize the functionality of...

1 minute read.

JSP pageContext

The object pageContext is used to access all the information of JSP page. It is an instance of javax.servlet.jsp.PageContext. The scope of pageContext can be defined explicitly. The object is valid...

2 minutes read.

JSP EL Implicit Objects

Apart from operators, JSP also provide expression language implicit objects. The role of these implicit objects is to get the attribute associated with various object. Here, is the list of...

1 minute read.

JSP Action Tags

As the name implies, JSP action tags are used to perform various actions during the execution of JSP page. Here, each action performs some specific task. These tasks include:  Forwarding the...

1 minute read.

JSP config

JSP config object is used to send the configuration information to JSP page. Here, config is an instance of servlet's ServletConfig interface. In this case, the information is send to...

1 minute read.