Solved

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

Posted on 2004-03-30
4
2,649 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
jarasa earned 25 total points
ID: 10715199
0
 

Author Comment

by:mvkraju
ID: 10715309
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
ID: 10715321
:c)
0
 

Author Comment

by:mvkraju
ID: 10786502
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Clear browser cache on site login, is it possible? 3 34
struts exact match support 3 61
maven webservice example issue 2 157
how to add new optional parameter to JSP 1 56
This article was originally published on Monitis Blog, you can check it  here . If you have responsibility for software in production, I bet you’d like to know more about it. I don’t mean that you’d like an extra peek into the bowels of the sour…
In order to fulfill our mission of inspiring learning in the technology community, Experts Exchange is launching a Course of the Month program. Premium and Team Account members will have access to one course per month as a part of their membership, …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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