• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

access to local variable via EL

 
Wim Bervoets
Greenhorn
Posts: 4
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I defined following variable via a scriplet in a JSP:



How do I access this variable via the Expression Language (EL), for instance in a loop? The following piece of code doesn't work:



Thanks in advance,
Wim.
 
Jan van Mansum
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you'll have to set it in a scope (e.g, the page scope).
For instance:
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EL expects to find your variables as an attribute of some scope. Try adding the below line to your scriptlet and see if it works:

pageContext.setAttribute("teams_ES", teams_ES);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic