Accessing a jstl variable inside a scriptlet
问题 The following code causes an error: <c:set var="test" value="test1"/> <% String resp = "abc"; resp = resp + ${test}; //in this line I got an Exception. out.println(resp); %> Don't I use the expression language "${test}" in the scriptlet.why? 回答1: JSTL variables are actually attributes, and by default are scoped at the page context level. As a result, if you need to access a JSTL variable value in a scriptlet, you can do so by calling the getAttribute() method on the appropriately scoped