Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding usage of scriplet variable in EL

 
rachna jain
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All



Given the following contents of a JSP page what will happen when you attempt to compile and run it?

<%
int i = 1;
int j =2;
%>
${i < j}
${1 lt 2}

Ans : false true.

Well i understood the answwer as EL cant acees scriptlet variable.

But my doubt is if we put variable in some scope of servelet then we can aceess it from inside EL or is it we can never access it.

Please clarify
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
all variables put in PAGE, REQUEST, SESSION or APPLICATION scope are visible to EL
 
rachna jain
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again
 
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!