wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts2 + Hibernate + paging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 + Hibernate + paging" Watch "Struts2 + Hibernate + paging" New topic
Author

Struts2 + Hibernate + paging

Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 686

Hello friends i want to create paging with help of Struts2 + Hibernate please help me if any one know ....

Thanks,


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

You can go ahead using display tag for it.


Time is what we want the most, but what we use the worst. -- William Penn
hung kin
Greenhorn

Joined: Nov 18, 2008
Posts: 6
I don't understand you. you can say careful....
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

There's a project called Display Tag.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 686

HI,


You can refer this link for more detail.

http://displaytag.sourceforge.net/11/


Thanks,
Nishan Patel.
Java Developer.
hung kin
Greenhorn

Joined: Nov 18, 2008
Posts: 6
thank you
I user DisplayTag page 1-ok but it not display page 2,3 =>no data
???
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

@Nishan: not sure how that link provides any more detail than mine, since they're the same link.

@Hung: You'll need to look at the display tag docs or ask on a display tag forum/list, it's not really a Struts question.
Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

hi all, Struts 2 is a very rich framework and you will enjoy working on it.. and nishan if you are serious using display tag we can further discuss if you are stuck...

happy developing...
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 686

Hello,

Thanks all of you,

But i want to know can I use Struts tag in display tag.

Because i am not getting value while I use Struts tag in display tag.



Thanks,
Nishan Patel
Java Developer
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Because i am not getting value while I use Struts tag in display tag.

That it actually not enough information to help.

It might make sense to post some example code that isn't working--how else will we be able to figure out what might be wrong?!

http://faq.javaranch.com/java/TellTheDetails
[ November 21, 2008: Message edited by: David Newton ]
Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

yes nishan you can always use struts2 tag inside display tag and vice versa... but i agree with david... you can leave us a bit of code there to make us motivated


happy developing
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 686

Hello ,


This is my code.
Can i use this. ?

<display:column headerClass="Table-Head" title="Status">
<input type="checkbox" id="active"
name="active" value="<s roperty value="id" /> />
<input type="hidden" name="checkedId" value="<s roperty value="id" />">
</display:column>
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 686

Hello David,

See, now i put my code. Now, tell me it is working or not ?
Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

hi nishan... you are using basic input tag to have a checkbox, however struts2 gives a wonderful utility to have checkbox in your page.
you can have a checkbox by using s:checkbox

for ex:

<display:column title="" >
<s:hidden name="YourList[%{#attr.row_rowNum - 1}].YourID" value="%{#attr.row.YourId}"/>
<s:checkbox name="select[%{#attr.row_rowNum - 1}]"
value="select[%{#attr.row_rowNum - 1}]" />
</display:column>

attr.tableId_rowNum is pure display tag feature to give you the row number and you can use it for indexing your rows... where "attr" is of display tag "tableId" is your tables id, and "rowNum" again is of display tag. "-1" is to start the first row or the header to be counted that display tag adds p to your list. hope you know the Ognl expressions used in this.


Happy developing...
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

See, now i put my code. Now, tell me it is working or not ?

How would I know if your code is working or not?
sanjiv tuli
Greenhorn

Joined: Apr 05, 2010
Posts: 3
Hi Nishan

Hope you solved your problem by comments posted above, i have just read this thread and i searched good link which has the solution of your problem with running application

http://javateacher.co.in/misc-frameworks/struts-2-x/struts2-pagination-using-display-tag/


Hoping it will help you


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 + Hibernate + paging