tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Smith" <sat-g...@home.com>
Subject Re: Building output page by page.
Date Sun, 19 Nov 2000 00:35:46 GMT
Hi Mark,

I'll repeat what I said in my earlier
response. You are not giving much
information about what you are doing.

You do mention making "database queries".

Lets assume you are accessing a DB with
sequel. In that case you can perform the following
type of query:

select * from some_table where primaryKey > min and primaryKey <= max;

Where min and max are limits you set. 
This would return a range of records between min and max, including max.

Translating into servlets:

A design that comes easily to mind would
use a controller servlet and a JSP page.

The controller is going to receive a POST from 
a webpage... The controller doesn't do anything,
just redirects output and passes on parameters.

form --> params( min, max) --> controller.

The controller redirects output to a JSP:

controller --> sendRedirect("/some.jsp?min=101&max=200");

The webpage is going to be produced as output
from a JSP called some.jsp:

JSP --> (current data, 101 through 200) and new form with code for next set of data.

...
current data
...

<form action="/servlet/Controller" method="POST">
<input type="hidden" name="min" value="<%=min%>">
<input type="hidden" name="max" value="<%=max%>">
<input type="submit" value="Get next one hundred entries">
</form>


If this doesn't make any sense you might want to
read up on the technology before going much farther.
A good start would be Java Servlet Programming 
by Hunter and Crawford.

Dave
  ----- Original Message ----- 
  From: Mark Koscak 
  To: tomcat 
  Sent: Monday, December 18, 2000 5:39 PM
  Subject: Re: Building output page by page.


  Hello again,

  I know someone responded to this message, I was unable to respond and the original message
was deleted. My apologies. (Don't ask long story...)

  At present it takes around 13sec to build a page of 1300 rows over 10MB Lan.  I am pushing
HTML output in a display method using out.println(...); right after my database table queries.

  My aim is to reduce the time it takes to display an initial page to the end user, by breaking
up the output into smaller chunks.  

  There is also a good chance that I will merge the two tables into one to reduce the database
connection requirements.

  Thanks Again.
  Mark

  /****************************************************************************************************************
  *    PREVOIUS MESSAGE
  ****************************************************************************************************************/

  Hello everyone,

  I have build a Servlet application that creates a single HTML page with up to 1300 rows
in a table.

  Can anyone give me some links or advice on how I can break this output into HTML pages with
say 100 rows per table, with a corresponding selection bar at the bottom of each screen, giving
the user access to any page they click on?

  Thanks in advance.

  Mark

Mime
View raw message