• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

[struts] How is struts.jar in classpath?

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My struts application is working, but..
I would like to know how the struts classes are found. They are in WEB-INF\lib\struts.jar, but I can't see how this is in the classpath. Obviously I'm missing something, can anyone tell me what?
Thanks!
Mars
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's classpath/classloader magic!
Because you are putting your jars, and classes, in a webapp, the container you are using knows where to find them - WEB-INF/lib and WEB-INF/classes respectively.
Pretty darn handy.
 
Marcellus Tryk
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So the container (Tomcat in this case) loads any classes found in jars in lib? That seems to be the case because I renamed struts.jar to some other arbitrary name and the app still worked.
Thanks for your help Chris!
Mars
[ July 22, 2002: Message edited by: Marcellus Tryk ]
 
Author
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, this is how webapps work. All JAR's in lib are automatically in your apps classpath, as is the classes directory.
 
I think he's gonna try to grab my monkey. Do we have a monkey outfit for this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic