• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

q on EL

 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
identify the o/p of the folliwing code fragment
<% session.setAttribute("varcents","20");
%>
$100.${varCents}

Select 1 option.
1) compilation error.
2) ClassCastException will be thrown as varCents is a string.
3) Page prints $100.20
4) Page prints $100.$20

Plz help. i hv no clue. I think it is 1.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

identify the o/p of the folliwing code fragment
<% session.setAttribute("varcents","20");
%>
$100.${varCents}

The output will $100.

There is no varCents attribute in any scope. The attribute names are case sensative.

If the scriptlet sets
<% session.setAttribute("varCents","20");
%>

The output will $100.20

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic