Scripts are raw java embedded in the page code, and if you declare variables in your scripts, they become local variables embedded in the page.
In contrast, JSTL works completely with cloud attributes, either in the page , request , or session . You need to redo your scriptlet to catch test as an attribute:
<c:set var="test" value="test1"/> <% String resp = "abc"; String test = pageContext.getAttribute("test"); resp = resp + test; pageContext.setAttribute("resp", resp); %> <c:out value="${resp}"/>
If you look at the docs for <c:set> , you will see that you can specify scope as page , request or session , and default is page .
Better yet, don't use scriptlets at all: they make your child sigh.
skaffman Aug 25 '10 at 21:11 2010-08-25 21:11
source share