Solved

Hot to use <logic:iterate> tag to retrieve specific index value in struts

Posted on 2004-03-30
4
2,642 Views
Last Modified: 2012-06-27
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_COUNTS_HDR %>" >
<logic:notEmpty name="<%= WebConstants.MESSAGE_COUNTS_HDR %>" >
    <TD valign="TOP" class='TableText' height="12">
         From <logic:iterate id="hdrVec" name="<%=WebConstants.MESSAGE_COUNTS_HDR %>" indexId="0" /> to <logic:iterate id="hdrVec" collection="<%=WebConstants.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\workspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\localhost\server1\iaInfoServices\iaInformation.war\_rptMsgCounts.java:257: Invalid expression statement.
                      java.lang.Integer 0 = null&#59;
                               ^
There is some thing wrong with <logic:iterate> tag
I need help please!!

Thanks
0
Comment
Question by:mvkraju
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
jarasa earned 25 total points
Comment Utility
0
 

Author Comment

by:mvkraju
Comment Utility
o.k. i could figured it out
Here is the working code

<logic:iterate id="hdrVec" name="<%=WebConstants.MESSAGE_COUNTS_HDR %>" offset="0" length="1"  > <bean:write name="hdrVec" /> </logic:iterate>

Thanks
0
 
LVL 6

Expert Comment

by:jarasa
Comment Utility
:c)
0
 

Author Comment

by:mvkraju
Comment Utility
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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Marketing can be an uncomfortable undertaking, especially if your material is technology based. Luckily, we’ve compiled some simple and (relatively) painless tips to put an end to your trepidation and start your path to success.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now