aspose file tools*
The moose likes JSP and the fly likes how to generate serial number in jsp without using scriptlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to generate serial number in jsp without using scriptlet?" Watch "how to generate serial number in jsp without using scriptlet?" New topic
Author

how to generate serial number in jsp without using scriptlet?

shivam purohit
Greenhorn

Joined: May 02, 2011
Posts: 12

How to generate serial number in jsp without using scriptlet. I am using display tag.. Thanks in advance.
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1773
    
    7

Could you please elaborate, I have no idea what a 'serial number' would be and what 'display tag' refers to.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
shivam purohit
Greenhorn

Joined: May 02, 2011
Posts: 12

<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

Joined: Mar 10, 2008
Posts: 1773
    
    7

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

Joined: May 02, 2011
Posts: 12

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

Joined: May 02, 2011
Posts: 12

What should i write in value attribute.? :(
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to generate serial number in jsp without using scriptlet?