I am trying learn more about JSP expression evaluations. How and which variables are determined to be in scope for access by expressions?
I have a simple JSP (ELEvaluator is a convenience wrapper)
<% String foo = "bar"; %>
<%= ELEvaluator.evaluate("${foo}", request, pageContext) %> //-> blank
<%= ELEvaluator.evaluate("${1 + 1}", request, pageContext %> // -> 2
Do these vars/objs have to exist on the request obj? or be registered with the pageContext/Evaluator?
Thanks
${foo}meansSo, if you want some object to be available to the EL, store it in the appropriate scope: