• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using variable in expression language

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know if we can use variables defined in a scriptlet in a an expression language ?

For example, I defined the variable var as following:

<%! String var = "a variable"; %>

Then i try to test if this variable is equal to "a variable"

${var eq "a variable"}

this returns false, i guess the evalaution of the variable var returns null because EL are only looking for variables in any scopes but I am not sure ! That is why I am asking you this simple question.

If there is a special way to access those variable, let me know.

Thanks you in advance
Tiggy
 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only implicit variables and variables defined in one of page,request,session or application scopes are available to EL.

So there is no special way to access these varuables unless you add them to some scope.
 
Adri Smith
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot for your response, that helps me a lot in my preparation of the certification SCWCD 1.4
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic