Forums Register Login

Using variable in expression language

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Thanks a lot for your response, that helps me a lot in my preparation of the certification SCWCD 1.4
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 609 times.
Similar Threads
Scripting with JSTL Core tags.
global veriable + hyper link
Try Ruby! 15 minutes
class-Vs-instance vars ..why initialized....???
Problem in javascript variable declaration.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:28:05.