You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Maya menon <ma...@yahoo.com> on 2007/06/05 20:09:29 UTC

Struts-Jsp display

All,
  I have a requirement in which I display reports in a jsp using Struts. The reports pull huge data like 30000-50000 records will be in the jsp page.
   
  Right now, I get the records in an array from my DAO and then set them to my form bean. In results jsp, I iterate through it and use <bean:write> tag to write all values in jsp.
   
  This approach is pretty slow. After it displays all records the page simply hangs. From IE page I cannot move forward/backward etc
   
  Can anyone suggest an improvement ?
   
  In DAO i just do JDBC select and get the records. JDBC retrieves query fast.
   
  Thanks.

       
---------------------------------
Got a little couch potato? 
Check out fun summer activities for kids.

Re: Struts-Jsp display

Posted by Antonio Petrelli <an...@gmail.com>.
2007/6/5, Maya menon <ma...@yahoo.com>:
>   Can anyone suggest an improvement ?

I think that you need some sort of paging.
One of the most used technique is by using displaytag:

http://displaytag.sf.net/

HTH
Antonio

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


AW: Struts-Jsp display

Posted by Norbert Hirneisen <no...@s2you.de>.
Hi Maya,

I suggest you should implement a paging mechanism not only on the struts side
but also on the query side as well.
Take you original select and enclose it by an outer select using the rownum to
fetch only the records needed for display.
A simple example (Oracle 10g):
Original query: select * from s2location
Now with an additional outer select
select * from
(
select * from s2location
) x 
where rownum>10 and rownum<=20

Then you use variables for min and max rownum  and you are able to fetch only
the records needed from the database. Your action can use parameters or you can
use custom tags to implement the paging.
Advantage: your bean with the records holds only the records displayed and
therefore you need little memory. Disadvantage: every paging action triggers a
database select.
As far as I know the displaytag uses the other approach: store the entire select
in a bean and navigate through it. From the point of the user this is very fast
as the entire result set is already in the memory and paging is easy. But it
needs a lot of memory and you should not have a lot of similiar objects in your
application.
The decision which way to go depends on your application layout and hard- and
software enviroment.
We have a dedicated Oracle server and an dedicated App-Server and are using
mostly query based paging.

Regards,
Norbert
 
Norbert Hirneisen
 
science4you Online-Monitoring
 
Please visit us:
http://www.science4you.org
(in German)
 

Norbert Hirneisen
Science & Communications
von-Müllenark-Str. 19
53179 Bonn
phone +49-228-6194930




-----Ursprüngliche Nachricht-----
Von: Maya menon [mailto:maya_java@yahoo.com] 
Gesendet: Dienstag, 5. Juni 2007 20:09
An: user@struts.apache.org
Betreff: Struts-Jsp display


All,
  I have a requirement in which I display reports in a jsp using Struts. The
reports pull huge data like 30000-50000 records will be in the jsp page.
   
  Right now, I get the records in an array from my DAO and then set them to my
form bean. In results jsp, I iterate through it and use <bean:write> tag to
write all values in jsp.
   
  This approach is pretty slow. After it displays all records the page simply
hangs. From IE page I cannot move forward/backward etc
   
  Can anyone suggest an improvement ?
   
  In DAO i just do JDBC select and get the records. JDBC retrieves query fast.
   
  Thanks.

       
---------------------------------
Got a little couch potato? 
Check out fun summer activities for kids.


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