• Post Reply Bookmark Topic Watch Topic
  • New Topic

EL question

 
Zhixiong Pan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a simple question about the EL here,

<%
request.setAttribute("Two","2");
Integer One = new Integer(1);
%>

${One + 1}


Why the output is "1"?
 
S Vilish
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no defined attribute called "One" so it will be treated as zero in arithmatic operations.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!