• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding objects to session

 
Mallika Kumar
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm currently querying four tables based on what the user enters in the query, and getting all columns from them, and storing the resultset in a vector object. First, I'm displaying few columns from the resultset and a unique column, which is a href, in an intermediate display page. Next, when the user clickes on the unique column, he's taken to a details page which shows that particular row's information. I'm adding this vector object to the session in the intermediate display page, so that I can retrive it based on unique column on which the user clicks, in the details page. My doubt is, I'm adding all the rows in the resultset to the session, so that I can retrieve it on the next page depending on what unique row the user wants. But adding such objects, especially when they can be huge depending on the query, doesn't seem to be right.
I thought of adding only the row which the user wants to see,to the session object in the jsp page, but unless they click on the unique column and goto the details page, I won't know which row it is. As I'm displaying all rows in the resultset in the intermediate display page, I'm adding all these rows into the vector, then into the session.
Can anyone suggest a better way of doing all this ? Ant suggestions would be helpful.
Thanks.
 
Kevin Mukhar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several ways you can approach the problem. Here are two ideas.
- Show only x results per page. Then you only need to store the details for x rows
- Don't store any details in the session. When the user clicks a link for details, perform another db query to get the details
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic