• Post Reply Bookmark Topic Watch Topic
  • New Topic

which class loads my servlet  RSS feed

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As we dont write main method in our programs in servlets which class loads our own developed servlet and how it knows the name of the class?
i have checked that main method is in container which implements servlet specification
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The servlet container loads the classes.
How the container implements it's loaders is up to the builders of the container.

It knows the class name because you specify the class name in the servlet entry in your deployment descriptor (web.xml).
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
t i am not defining servlet path in the web.xml..
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and what is the difference between normal classloader(the classloader which comes with jdk) and tomcat classloader
what are the enhancements?what is the reson to implement their own classloader for loading servlts.. why dont they use same same old classloader for loading servlets???
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Application Servers use classloaders as additional namespaces to partition the applications they are serving. The ClassLoader heirarchies can get a bit complicated and are slightly different from each vendor, but it is defined in the J2EE spec.

Dave
 
Nikhil Goel
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this http://www.objectsource.com/j2eechapters/Ch21-ClassLoaders_and_J2EE.htm

It will clear all the class loading doubts.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!