File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Servlets and weblogic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlets and weblogic" Watch "Servlets and weblogic" New topic

Servlets and weblogic

mikey mikey

Joined: Jul 10, 2001
Posts: 1
Hi all,
I have a question and I hope someone can help me. I am creating a servlet, that is called everytime there is an action on JSP web page. What I want to do is load several Trees, vectors, and one bean, I want to only have to load these items the first time that I initialize the servlet. This succeeds in Tomcat but not in weblogic. Does anyone have any ideas? I would really appreciate it.
thank you
Ranch Hand

Joined: Jul 06, 2001
Posts: 257
All servlets have an init() method that is called when the servlet is first loaded. You can perform your object initialization in this method, or, you can create a static block in your servlet that will execute when the class is loaded by the JVM. The only downside for the latter is that you can only access static methods and data in a static initializer, you cant access instance variable.
I agree. Here's the link:
subject: Servlets and weblogic
It's not a secret anymore!