mvkraju
asked on
Hot to use <logic:iterate> tag to retrieve specific index value in struts
Hi,
I have added vector to request object in the action class, i added 3 elements to the vector.
I wanted to access this vector in a jsp page. I am using <logic:iterate> tag to access the specific element of the vector
this is my code
<logic:present name="<%= WebConstants.MESSAGE_COUNT S_HDR %>" >
<logic:notEmpty name="<%= WebConstants.MESSAGE_COUNT S_HDR %>" >
<TD valign="TOP" class='TableText' height="12">
From <logic:iterate id="hdrVec" name="<%=WebConstants.MESS AGE_COUNTS _HDR %>" indexId="0" /> to <logic:iterate id="hdrVec" collection="<%=WebConstant s.MESSAGE_ COUNTS_HDR %>" indexId="1" />
</TD>
</logic:notEmpty>
</logic:present>
It's giveing the following error.
enerated servlet error:
C:\Documents and Settings\Z001532\My Documents\IBM\wsad\workspa ce\.metada ta\.plugin s\com.ibm. etools.ser ver.core\t mp0\cache\ localhost\ server1\ia InfoServic es\iaInfor mation.war \_rptMsgCo unts.java: 257: Invalid expression statement.
java.lang.Integer 0 = null;
^
There is some thing wrong with <logic:iterate> tag
I need help please!!
Thanks
I have added vector to request object in the action class, i added 3 elements to the vector.
I wanted to access this vector in a jsp page. I am using <logic:iterate> tag to access the specific element of the vector
this is my code
<logic:present name="<%= WebConstants.MESSAGE_COUNT
<logic:notEmpty name="<%= WebConstants.MESSAGE_COUNT
<TD valign="TOP" class='TableText' height="12">
From <logic:iterate id="hdrVec" name="<%=WebConstants.MESS
</TD>
</logic:notEmpty>
</logic:present>
It's giveing the following error.
enerated servlet error:
C:\Documents and Settings\Z001532\My Documents\IBM\wsad\workspa
java.lang.Integer 0 = null;
^
There is some thing wrong with <logic:iterate> tag
I need help please!!
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:c)
ASKER
jarasa i am awarding the points to you.
I hope you will try to give answers from next time onwards instead of the links.
Unfortunately opache has poor documentation. They did not give any examples.
I hope you will try to give answers from next time onwards instead of the links.
Unfortunately opache has poor documentation. They did not give any examples.
ASKER
Here is the working code
<logic:iterate id="hdrVec" name="<%=WebConstants.MESS
Thanks