Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock exam question: what is the effect of %@ page isELIgnored="true" %

 
Becca Hughes
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Head First Servlets and JSP study guide, chapter 7, mock exam question number 6 is:
Given: %@ page isELIgnored="true" %
What is the effect?

I selected option D: the JSP containing this directive should NOT have any Expression Language code evaluated by the JSP container.

The book says option E is correct: this page directive will only turn off EL evaluation if the DD declares a el-ignored true /el-ignored element with a URL pattern that includes the JSP.

I don't understand why I'm wrong and the book is right. It seems to me that I'm right, and the book is wrong...

Note: I had to remove the greater-than and less-than signs in the code snippets so that I could add this topic.
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@ page isELIgnored="true" %>

JSP supplies the isELIgnored tag which turns Expression language parsing on and off on a page by page basis. The following directive turns off the parsing of EL tags. Changing from true to false will mean that EL tags will be recognised.

Configuring JSP's using Property Groups
[ September 08, 2006: Message edited by: Saif Uddin ]
 
Kalaivanan Durairaj
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I got a question on this same topic in exam.

Lets take this statement ${5 + 5}

If ELIgnored="false" then the following is sent as response to client

10

If ELIgnored="true" then the following is sent as response to client

${5 + 5}

The EL statement is just treated like a template text. As it says, EL is just ignored, not disabled. Note, when you set <scripting-disabled> tag to true in DD then the JSP MUST NOT contain scripting.
 
kiko carlos
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The letter (E) says:
Thispage directive will only turn off EL **evaluation** if the DD declares a <el-ignored>true</el-ignored> is used. Then Does the declaration not have effect?


Kiko
 
kiko carlos
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The letter (E) says:
Thispage directive will only turn off EL **evaluation** if the DD declares
a <el-ignored>true</el-ignored> is used.
Then Does the declaration <%@ page isELIgnored="true" %> not have effect?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic