jstl can’t read scripting variable

I always keep forgetting this. Consider this code:

<%
boolean b=true;
pageContext.setAttribute(“B”,Boolean.TRUE);
%>

b=<c:out value=”${b}”/>
B=<c:out value=”${B}”/>

//Output:


b= B=true

Explanation:
JSTL can’t read scripting variable.  It only looks in the 3 scopes page,request and session.

Strange syntax in struts tags for property attribute

<html:link href=”xyz.do” name=”myBean” property=”myprop[0]”>Click here</html:link>

This how struts retrieves the value myBean.getMyProp(0). Hmmmm…..

Found the reason here
http://struts.apache.org/1.x/struts-taglib/indexedprops.html