Page Directive attribute - isELIgnored


 

Page Directive attribute - isELIgnored

This tutorial contains description of isELIgnored attribute of page Directive.

This tutorial contains description of isELIgnored attribute of page Directive.

Page Directive attribute - isELIgnored

This tutorial contains description of isELIgnored attribute of page Directive.

isELIgnored Attribute :

page directive provides isELIgnored attribute which is of boolean type. This attribute controls the JSP Expression Language. The cause to use Expression Language is to eliminate java, Code from the Jsp. The true value of this attribute indicates that any Expression Language is ignored. False value allow you to use the EL.
For JSP 1.2 version the default value of isELIgnored is true but for JSP 2.0 version and above the default value is false.

Syntax :

<%@ page isELIgnored="false" %> <!-- default value for JSP 2.0 -->

<%@ page isELIgnored="true" %> <!-- default value for JSP 1.2 -->

Example :

<%@page isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<title>Tag Example</title>
</head>
<body>
<font color="blue" size="5"> 
<c:set var="name1" value="Rose"></c:set>
<c:set var="name2" value="India"></c:set> <c:choose>
<c:when test="${name1 eq 'Rose'}">
<c:set var="name" value="${name1}${name2}" />
<c:out value="${name}"></c:out>
</c:when>

<c:otherwise>
<b>${name}</b>
</c:otherwise>
</c:choose> 
</font>
</body>
</html>

Output : Here is output of the code-

If you assign value "false" to isELIgnored attribute you will get output -

If you put value "true" for isELIgnored attribut you will get output -

Ads