• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlets and weblogic

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
SAF
 
reply
    Bookmark Topic Watch Topic
  • New Topic