• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception in using logic:iterate tag's 'indexId' property in struts

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When i use <logic:iterate> 'indexId' property in struts, I am getting following exception:

Compilation of 'C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_QPanel_QPanel\jsp_servlet\__maincategory.java' failed:
--------------------------------------------------------------------------------
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_QPanel_QPanel\jsp_servlet\__maincategory.java:536: operator + cannot be applied to java.lang.Integer,int
probably occurred due to an error in /MainCategory.jsp line 51:
<td width="10%" align="center"><%= rowSeq+1 %></td>


He is my few lines of code which causing compilation error:

<logic:iterate id="cId" property="mainCategoryGrid" name="frmMainCategory" indexId="rowSeq">
<tr>
<td width="10%" align="center"><%= rowSeq+1 %></td>
<td width="30%" align="left"><bean:write name="cId" property="mainCategoryName"/></td>
<td width="45%" align="left"><bean:write name="cId" property="desc"/></td>
</tr>
</logic:iterate>

I am using weblogic server 8.1.

Can anyone give me solution??
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An index ID is always of type Integer, not int. Therefore you will need to change your expression to:
<%= rowSeq.intValue()+1 %>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic