my dog learned polymorphism*
The moose likes Servlets and the fly likes How i can create multiple pages dinamic with a servlet ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How i can create multiple pages dinamic with a servlet ?" Watch "How i can create multiple pages dinamic with a servlet ?" New topic
Author

How i can create multiple pages dinamic with a servlet ?

Federico Delgado
Greenhorn

Joined: Nov 07, 2003
Posts: 2
Hi people:
I'm a beginner developer JSP/Java and i need a help to create some application for display the result of my search in DB in multiple pages ...
Like a forum, with previus and next stuff ...
Someone can help me ?!
Thanks !
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I'm not aware of a safe, generalized way to do this. I've done several apps where we retrieved data from a backend service and limited the number of rows that would fit in one response. If the user wants to see more data, the client has to ask for the "next" set of rows.
If the data is not changing all the time, this isn't too hard. We have used a row number so the client request is give me rows 51-75, 76-100, etc. The server repeats the query used the first time, skips n rows, and gives back the next batch. We have also used the last primary key retrieved - give me 25 rows starting with the first key > this one. Either of these runs into trouble if the result set is changing - more rows or fewer rows or different rows than it had last time. Page forward might skip some rows. Page forward and backward might not give you the same results you saw before.
I suppose the surest way to give the user a self-consistent view is to retrieve the whole superset and store it somewhere, then page forward and backward through the private copy. That blows away the notion of a stateless server, tho.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Federico Delgado
Greenhorn

Joined: Nov 07, 2003
Posts: 2
Thank you for the idea ... But you have a sample code for that ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How i can create multiple pages dinamic with a servlet ?
 
Similar Threads
How to create Multiple Tomcat instances????
multiple user inputs on a tabbed pane
Multiple Windows
multiple pages in one frame
Custom Tag Question