• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL question

 
Grace Yang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand ${empty one} returns true;

but how come following snippet still returns true?
<%String myVal = "hello"; %>
${empty myVal}

Thanks
Grace
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are confusing scriptlet variables (java variables) and EL variables. You cannot access scriptlet variables from EL, unless you put its value in a scope . Try adding request.setAttribute("myVal", myVal); in your scriptlet, and check what it does.
 
Grace Yang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Satou !!

You're right.

Grace
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic