Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to generate serial number in jsp without using scriptlet?

 
shivam purohit
Greenhorn
Posts: 12
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to generate serial number in jsp without using scriptlet. I am using display tag.. Thanks in advance.
 
Jelle Klap
Bartender
Posts: 1951
7
Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please elaborate, I have no idea what a 'serial number' would be and what 'display tag' refers to.
 
shivam purohit
Greenhorn
Posts: 12
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<display:table id="bookShopOLS" name="itemList" requestURI="/bookShop.do?parameter=showCatalog" pagesize="10" cellpadding="0" cellspacing="0" class="stripe">

<display:column title="<center>Serial Number</center>"
style="width:9%; text-align:center; word-wrap:break-word" sortable="true">
</display:column>

<display:column title="<center>Item Image</center>"
style="width:9%; text-align:center; word-wrap:break-word" sortable="true">
<a href="javascript: void(0);" class="alignCenter"
onclick="showImagePreview('<bean:write name="bookShopOLS" property="itemCode" />');"
title='<bean:write name="bookShopOLS" property="itemCode" />'>Photo</a>
</display:column>

<display:column title="<center>Item Name</center>"
style="width:9%; text-align:center; word-wrap:break-word" sortable="true">
<bean:write name="bookShopOLS" property="itemName" />
</display:column>

<display:column title="<center>Item Description</center>"
style="width:9%; text-align:center; word-wrap:break-word" sortable="true">
<bean:write name="bookShopOLS" property="itemDesc" />
</display:column>

</display:table>



this is my code. In that i have written serial number(sequence numver/ index) . i want values in that like 1, 2,3,4....etc....depending on items in tht page.
I think now you will get idea about it. Actually i can write code like [ <% int i=0 %> then i++; ] but i don't want to use scriptlet.. please give me any idea.
thanks
 
Jelle Klap
Bartender
Posts: 1951
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will you be using this sequence number just for rendering purposes, or will it be used to identify a specific item later on, for instance when a user submits an item selection?
If the former, you should probably have a look at the implicit objects made available by the table tag of the Display Tag library.
 
shivam purohit
Greenhorn
Posts: 12
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Klap for reply,

I didn't get that solution.:(
i tried some combinaton to write "<c:out value="${id+1}"/>" type code. but didn't get success.
 
shivam purohit
Greenhorn
Posts: 12
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What should i write in value attribute.? :(
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic