tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Layman <randy.lay...@aswethink.com>
Subject RE: search display problem
Date Wed, 14 Feb 2001 12:30:49 GMT

	First, I would suggest using a List (probably a LinkedList, see
javadoc for java.util for more information) because its more efficent.

	Second, your problem is because it sounds like when the user moves
forward or backward and then hits reload, they are sending the same request
as before- move forward or move backward.  Your links should instead pass
something like view page so that when they reload the server sees the same
request - view page X.

	Randy

PS If you have more questions, lets move this off the list.


-----Original Message-----
From: Vikramjit Singh [mailto:vikramjits@gtl.co.in]
Sent: Wednesday, February 14, 2001 12:05 AM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: search display problem


thanx randy for ur ideas.
 what i am doing is that i am getting all the records from the database and
storing in a vector. and that vector i am storing in a session. Now this
session is being passed on to the next page where i get all the records. my
next and previous links are working but whenever i press the refresh button
by default the next 10 or previous 10 records are shown. 
i know that this is not a good idea and the last idea you suggested me i
have also thought about it and i have also thought of using HashTable. But
still i am not sure whether this will solve my problem
anyway thanx for ur ideas
bye
vikram

> -----Original Message-----
> From:	Randy Layman [SMTP:randy.layman@aswethink.com]
> Sent:	Tuesday, February 13, 2001 4:34 AM
> To:	tomcat-user@jakarta.apache.org
> Subject:	RE: search display problem
> 
> 
> 	This probably isn't the proper forum for this, but I'll answer
> anyways.
> 
> 	You could just put the ResultSet into your session.  This is
> probably a bad idea since you would be keeping database connections open
> for
> long periods of time.
> 
> 	You could keep an index you're at as part of the session/parameter,
> then on every time you return to the page you would perform the query
> again,
> skip the appropriate number of rows and continue.  (Depending upon your
> database server you might be able to indicate to it not to return the
> extra
> rows).  The problem with this is that you are querying the database every
> time and probably going to be bringing back extra data.
> 
> 	You could suck in all of the resultset into some data holding object
> (List of basically C-style structs) and store this in the session.  Then
> use
> a current page variable to select the correct rows.  This would probably
> waste lots of memory but would limit the number of database accesses.
> 
> 	Another way would be to suck in all the records on the first access
> and include them in the web page by JavaScript.  The JavaScript would then
> control the page display.  This would be ultra-fast and would eliminate
> server access, but it would take longer to download each page.
> 
> 	There are several other alternatives available by mixing several of
> these methods.  It seems to me that typical access will be to look at the
> first several pages more frequently, so you might pull in those records
> into
> memory and only have to go back to the database when they request
> something
> like page 5 or 6.  (Fetch X pages of records at a time).  This hybrid
> would
> also work well with the last solution - send the user 4 pages of results
> and
> then to move to the next age you need to access the server.
> 
> 	Just some quick thoughts.
> 
> 	Randy
> 
> -----Original Message-----
> From: Vikramjit Singh [mailto:vikramjits@gtl.co.in]
> Sent: Tuesday, February 13, 2001 12:54 AM
> To: tomcat-user@jakarta.apache.org
> Subject: search display problem
> 
> 
> hello everybody,
> i have a problem. i am making a search page in which all the records are
> being displayed from the database. Now what my problem is that i want to
> make it look like Google site. in which every page has 10records and when
> i
> click on the link then i get to see the records with 10 pages. if anybody
> of
> you has gone through this then plz tell me how to do it. any idea is
> welcome
> bye
> vikram
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-user-help@jakarta.apache.org

Mime
View raw message