struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Bush <ekb...@swbell.net>
Subject Re: Continuous datastream from server to client
Date Tue, 05 Nov 2002 22:32:32 GMT
If you're using OJB, you have access to the Query interface.  That 
particular interface is *very* useful.  You can specify a beginning 
index and an ending index.  With minimal coding on your part, it's 
super-simple to have something that will do pagination.  I went so far 
as to give my DAOs which may return collections another method with a 
signature that allows me to specify a page number and a page size - have 
that method determine the start/end index (very simple logic - 
encapsulate it somewhere [like your base DAO] and just invoke it), 
execute the query, and return me the collection.  Very easy to do.

- search ojb-user
- examine the Query interface (org.apache.ojb.broker.query package, if 
memory serves).

I still say generate it as a CSV download.  I can't imagine why you 
couldn't generate the CSV dynamically.  I know I don't determine a 
content-length for dynamic pages I build.  You will need to set the 
content-type though (text/??? - no clue what the mime type for CSV is). 
 Plus, generating large dynamic tables can be ... problematic.

Reinhard Dunst wrote:

>Hi, thanks for answer.
>I'm using OJB for database access but for the moment without proxy.
>I think the user is responsible to print only lists of acceptable lenght.
>But if he
>wants to print a long list he should do, across ?? pages and not page by
>page.
>When I saw, that I could run into memory problems, my next idea was to use
>the PrintWriter from HttpServletResponse, create html code and flush every
>10th row.
>But I never tried it. An other Idea is to create a PDF File in the
>background. During creation I render a pagecounter on a seperate page and
>when finished I create a link on output page, but thats my last option.
>
>So you think, there is no way to send data with undefined length from server
>to the client?
>
>Reinhard
>

-- 
Eddie Bush





--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message