Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Mock Exam Query

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I can acoss this Question in Mock exam on Jiris.com . Please help me


<%int [] nums={42,420,4200};
request.setAttribute("foo",nums);%>
${5+3 lt 6}
${reuestScope['foo'][0] ne 10 div 0}
${10 div 0}

whats the Result

A) true true
B) false true
C) false true 0
D) true true Infinity
E) false true infinity
F) An exception is thrown
G) Compilation in translation Fails

Answer) E

THis is the answer given. This is Strange as in EL, null is handled gracefully as per Hfsj

Pls correct me IF I am wrong? Wat would be the right answer?

This is another question.

2)IF ELIgored property in XML is set to true then will any scripting or EL function that is enoucntered would be just ignored and displayed on JSP

Example:

if this is written in the JSP<b>${5*20}</b> then the output would be like
<b>${5*20}</b> or just ${5*20} or <b></b> or <b>100</b>
Which one is the right answer. I personaly feel out put would be ${5*20}
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What stopping you from trying these out yourself ?

The first answer seems right to me. No where in the code does a null occur.

The second answer should be ${5*20} since it is EL that is being ignored not HTML.
 
Can you smell this for me? I think this tiny ad smells like blueberry pie!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic