Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Large JSP Files

 
Kash Mhai
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
The app that i am building has some very large JSPs. Something to the tune of 100kb (JSP). when the page is accessed for the first time, the java file that is generated is at 700KB and the subsequent class file is around 110 KB. The subsequent hits to the page are pretty fast. But the first hit is taking a lot of time. Is there a way in which I can reduce the response time in the first hit? I have done the following and have also inferred the following -
1. The buffer size is set to 150KB with autoflush set to true.
2. Am using gzip compression to compress the data.
3. I have tracked each step of the process and i have come to the conclusion that the conversion to the .java and to subsequent .class is what is taking a long time, and NOT the actual execution.
4. I do know there is an option of pre-compiling the JSPs but am looking for options beyond this.

The server is WAS 5 and JDK is 1.4 with JSP 2.0. Am using Struts 1.3 (!!?) in the app.

Can anybody help? It could be in the form of tweaking the app server or a change in the code, any suggestions is appreciated.

Thanks,
Kash
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you firing any queries too in this JSP? If, yes, can they be optimized?

Now for the size of JSP:
Have a look at the code of the JSP and figure out if you can modularize the task that is being done by JSP. Put some tasks in bean/class/tags and call them in JSP.

Using Servlet is also an alternative, as your can load Servlet on the start-up.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The queries are not fired in the JSP. And the after the whole modularization, this is the filesize. Is the size of the class file generated connected to the buffer size in any way?.. I wonder!

Kash
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic