• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using variable in expression language

 
Adri Smith
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • 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
 
Sivasundaram Umapathy
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic