How to preload jar classes?

M

Marcus Leon

The first request of a jsp page using a tag library (Display Tag
Library) is slow. I believe it is due to the JVM having to load a
whole bunch of classes. Is there a way to get the JVM to preload these
classes?

We're running Weblogic 8.1.

Thanks.
 
T

Tor Iver Wilhelmsen

Marcus Leon said:
The first request of a jsp page using a tag library (Display Tag
Library) is slow. I believe it is due to the JVM having to load a
whole bunch of classes. Is there a way to get the JVM to preload these
classes?

Add the JSP as a servlet in web.xml and declare its load-on-startup
element.
 
M

Marcus Leon

Thanks Tor. But it doesn't seem to work. Looks like that calls some
basic init method but it doesn't actually do the processing of the JSP
page where the vast majority of the classes are loaded.
 
R

Roedy Green

Is there a way to get the JVM to preload these
classes?

Running a piece of code that called some static method in each class
you wanted to preload would do it. Or you could look at a public
static field, e.g. serialVersionUID.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top