aspose file tools*
The moose likes Struts and the fly likes How to Pagging with List<Object[]>? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to Pagging with List<Object[]>?" Watch "How to Pagging with List<Object[]>?" New topic
Author

How to Pagging with List<Object[]>?

Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

Hi Friends..

i want to build some student test application..
i have randomized the test question with Mersenne Twister Algorithm..

example the application will run like this :
the student can select the major. say that the student choose Information Technology major.
in the Information Technology major student must finishing the test questions..
say that the kinds of question is Math and Physics..
The Math questions is 20 questions..
and the Physics quetion is 30 questions..
assume that i have take the questions from my table randomized..
assume that the CategoryId of math is M-1, and the CategoryId for Physics is P-1

i want to display five questions for a page by the array, so i need around 10 pages for all questions, which will diplayed in the same page...
and the display is like :

introduction page :
Introduction about mathematic..

Question Type : Mathematic
Page : 1

go to page 2 (which used the same page) with Submit button..

Question Type : Mathematic
Page : 2

if the mathematic have finished all pages (4 pages) then the application will display :
introduction page :
Introduction about Physic..

Question Type : Physic
Page : 1

go to page 2 (which used the same page) with Submit button..

Question Type : Physic
Page : 2

last.. if the physic have finished all pages (6 pages) then the application will display the point..

is that the paging with List<Object[]> good of implementation?..
or Do i have to save all of the question in temporary table?.. if the test finish then the temporary table will be cleaned..

Please help me..
Thank's Before...


Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

Yeah..

still confusing about the solution..
maybe i choose to use the temporary table for the solution...

is it good for implementation?..
Thanks before..
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

I don not read OR try to understand your question, fully, But basically what you are asking is this.
Leonardo Carreira wrote:
i want to display five questions for a page by the array, so i need around 10 pages for all questions, which will diplayed in the same page...

This is simple, I get a logic for it.

1. Get a "Introduction" on a page, may be its in session or in a request. (Physics.jsp)
2. Get an List of "Questions" like, List<Question> of size 5. (Physics.jsp)
3. Iterate over it
4. Submit
5. In Submit action, get the next five question put into List, forward to the "Physics.jsp" page
6. Continue Step 2


HTH


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

Alright.. Thanks @Sagar for your reply...

i will try it

Thanks
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

My pleasure
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Pagging with List<Object[]>?