• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Exam Query

 
Nilesh Raje
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}
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic