Basic Question: Dynamic Java Classloading

Hi there,

i have a basic question, because i'm a java beginner:
Im working on a web project and my servlet needs to access some data from some "information-provider".
I want to write my servlet independend to the information-provider so i'm building a "info-bridge" bean which implements an interface.

I want to use an XML file, where i can configure what "info-bridge" java bean should be used (a bit like the spring-bean config stuff).

So i have the following XML:
  <information-interface class="myJavaPackage.myProject.bridges.provider1Bridge" />

What is the best way to load the class from my servlet? Is it Java Reflection or is there any other technique (because i read that java reflection is not very fast) or is there maybe any built-in feature of apache tomcat? What is common??

thx for your help and best regards
Who is Participating?
CEHJConnect With a Mentor Commented:
Reflection is fine - you shouldn't have to load the class very often anyway
objectsConnect With a Mentor Commented:
mesXAuthor Commented:
Thx for your quick responses and Tips!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.