Displaying Search Results in sets: using STRUTS

I

ibits

Hi Wonderfull people

One of my search based actions when invoked returns an collections of
search results.I'm using jakarta struts framework.
Since I don't want all the results to be displayed on one single page
,what should be my approach to display only 10 at at time and giving
user option of going to next or previous set

Its more like how google displays

Result page :previous 1 2 3 4 5 6 7 8 Next

I would appreciate everybody's answer .Whenever possible could you
explain with code snippets ?

thx all ,:)
Sid
 
R

Rick Osborn

Maybe someone has implemented this and knows more than me,
but here's my stab at it. Evidentally your resulting collection must
be bigger than can be displayed on single page.

Form <logic:iterate ...> tags to go only so far through that
collection and stop, marking where in the collection you've left off.
Say "currentStartPlacemark"/"currentStopPlacemark". Meanwhile form a
JSP that will query this data structure and extract/display the values
between these entries.

Each numerical link on the bottom of the page links to an action with
form params appended onto the end, which process that event. (i.e.
"<a href="grabNextIteration.do?nextStartplacemark&nextStopPlacemark")

This action queries the gathered collection once again, using these
indexes that have been passed along to gather next part of the
collection.


Actually there may be a pattern which deals with this more?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top