Very quick questions. Could someone explain to me why this code does not work?
<%@ taglib prefix="logic" uri="/WEB-INF/struts-logic.tld" %>
<%
int myValue= 2;
%>
myValue: <%=myValue%>
<br/>
<logic:equal name="myValue" value="2" scope="session">
logic:equal works!
</logic:equal>
Even if I change myValue to a String is still doesn't work
Quite frustrating, cause I know it's going to be something obvious.
Thanks in advance
KS
Working example!
<%@ taglib prefix="logic" uri="/WEB-INF/struts-logic.tld" %>
<%
request.setAttribute("myValue", 2);
%>
myValue - <%=request.getAttribute("myValue")%>]]
<br/>
<logic:equal name="myValue" value="2" scope="request">
logic:equal works!
</logic:equal>
<logic:equal name="myValue" value="2" scope="session">
This tag looks for a session attribute named "myValue". Not for a local variable named "myValue".
The real question is: why are you using a tag library which is marked as deprecated in favor of the JSTL, this library being part of a framework which is officially abandoned?