Hi, I have a search page where users enter in a set of search criteria and are then redirected to a search results page. I don't want to display all of results in one page, so I am working on implementing a paginated navigation bar along the top of the page which looks something like the following:
[first] [prev] [1] [2] 3 [4] [5] ... [9] [10] [next] [last] >From what I can tell, to make this work I need to pass the search criteria around to each of these pages so that it can re-run the database query using a different offset into the results. However, I am not sure what my options are much less which one is the best (this is the primary question of this email). Let me add that the user must be able to have several searches running at the same time in different tabs. So far, I've come up with the following ideas: Session Store the search criteria in the users session. From what I can tell this won't work because when the user starts a new search in a new tab the new search criteria will replace the search criteria used by the tabs and then those tabs will begin returning results from the new search... Page Context Store the search criteria in the page context (by encoding it into a string representation?). It seems like a large number of sites store their search criteria into the pages URL in one manner or another, however this results in some rather long and ugly URLs (on the bright side, the user can bookmark their searches and come back to them, right?). Also, I believe that I would have to be careful how I implemented this so that the search results page isn't open to SQL Injection attacks right? Page Context using a search ID Instead of storing the search criteria itself in the context, give it a unique ID and store that ID into the context. The search criteria would then be stored in a local map or into the database. However, how do you determine when the user is done with that particular search and flush its criteria from the data store? This seems like a fairly common thing to want to do on a website, is there some sort of Tapestry Patterns page that has best practices for common things like this? PS: please share with me other options I haven't considered. I would like to learn what other options Tapestry provides for situations like this one. Thanks in advance, [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
