JSP Page loading..

Hi,i got a jsp page which has 6000 records to be displaed in a table. i put a sop in last line of my jsp page. while executing that after tht sop its takin nearly 3 mins to load the page. wht i have to do to reduce that time?plz help me.
[265 byte] By [born4javaa] at [2007-11-26 18:10:18]
# 1

There are many things you can do

1) Implement paging/ pagination so that only a range of records are retrieved, so you can break 6000 to say some 500 records per page.

2) Optimize your SQL query, see if it is obtaining a cartisian product - cartisian sets take a very long time - simplify the JOINS.

3) Pre-compile your JSP pages with JSPC.

4) White-space compress the output

5) Remove unwanted code, optimize your java/jsp code

appy77a at 2007-7-9 5:42:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

thanks for ur timely help.

but my db query and records iteration in jsp everything is finished within 30 seconds. since i have printed the time for each process. after leavin my jsp page (i put system.out.println in my last line of jsp) its taking too much time to display in internet explorer.

can u tel abt that tools plz. hw to get it?

Message was edited by:

born4java

born4javaa at 2007-7-9 5:42:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

What tool are you looking for?

If you want to use the Jasper compiler you can call it from your Ant build script, here are the details on how to invoke it from Ant:

http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.html

It modifies your web.xml, and creates a mapping of each compiled JSP class file, so make a back-up of your existing web.xml

Also you can use this Firefox extension - Load Time Analyzer:

https://addons.mozilla.org/firefox/3371/ to measure the overall page performance.

If you want to white-space compress your files, you can use Ant's Replace Regular Expression task : http://ant.apache.org/manual/OptionalTasks/replaceregexp.html to find and replace extra white spaces with a single white space but you'll have to watch for certain things like open comments // otherwise it can break your application.

http://www.thoughtsgarden.com/p/side-effects-of-white-space-compression/

Message was edited by:

appy77

appy77a at 2007-7-9 5:42:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
thanks a lot i done it. now i have an another doubt. how to assign a javascript array to a java array which is n my bean.plz tel me.
born4javaa at 2007-7-9 5:42:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...