i have created variable in scriptlet in the following way in my jsp
<% int count= 0; %>
Based on some conditions i am incrementing the variable value…… (think now ‘count’ value is 5 )
Now i have to do some process if the ‘count’ value is 0 by using struts2 tags
i have tried the following ways. But i failed…………….
<s:if test="#count == 0" >
--------
--------
</s:if>
<s:if test="%{#count == 0}" >
</s:if>
Thanks in advance
Everyone has told you it isn’t a good idea… If you want a bad idea then:
Following must be at top of JSP:
Following someplace inside your JSP:
then this should work:
I didn’t take the time to test this but that is how the struts2 set tag does its job (if not a good idea it’s still a bit educational ).