mvkraju
asked on
how do we use <logic:equal> tag?
Hi,
I have code like this
<logic:iterate id="hdrVec" name="<%=WebConstants.MESS AGE_COUNTS _HDR %>" offset="0" length="1" > <bean:write name="hdrVec" /> </logic:iterate>
Now i want use empty tag with in the <logic:iterate> tag
like
<logic:iterate id="hdrVec" name="<%=WebConstants.MESS AGE_COUNTS _HDR %>" offset="0" length="1" > if this element is equal to "" then <bean:write name="hdrVec" /> else
just empty string i.e "" </logic:iterate>
please give me some code how do we use <logic:equal> tag in this scenario
thanks
I have code like this
<logic:iterate id="hdrVec" name="<%=WebConstants.MESS
Now i want use empty tag with in the <logic:iterate> tag
like
<logic:iterate id="hdrVec" name="<%=WebConstants.MESS
just empty string i.e "" </logic:iterate>
please give me some code how do we use <logic:equal> tag in this scenario
thanks
ASKER
For the given example i used offset="0" length="1" in the <logic:iterate> tag
in that case i am retrieving the first element from the collection.
here i don't know the parameter name, just i know the what idex it is
So what will be the parameter in this case?
in that case i am retrieving the first element from the collection.
here i don't know the parameter name, just i know the what idex it is
So what will be the parameter in this case?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
can i user offset and length attributes for the <logic:equal> tag?
if so i got solution for my problem.
if so i got solution for my problem.
ASKER
<logic:equal name="hdrVec" value="">
dothis
</logic:equal>
is working for me, just i need to put this logic between my <logic:iterate> tag
dothis
</logic:equal>
is working for me, just i need to put this logic between my <logic:iterate> tag
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-logic
<!-- Is the number guess right? -->
<logic:equal parameter="number" value="7">
You guessed right! You win a high speed blender!
</logic:equal>
<!-- If the number guessed was wrong -->
<logic:notEqual parameter="number" value="7">
<!-- Less Than -->
<logic:lessThan parameter="number" value="7">
A little higher...
</logic:lessThan>
<!-- Greater Than -->
<logic:greaterThan parameter="number" value="7">
A little lower...
</logic:greaterThan>
</logic:notEqual>
Javier