• 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic