• 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

Place for class files : install_dir/webapps/ROOT/WEB-INF/classes or install_dir/shared/classes

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,

I have just started learning servlet and jsp . I am using tomcat version 5.5.31 , jdk 1.6 and vista . I configured tomcat according to the tutorial on http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-5.5.html.

After compiling a very basic servlet example I placed the class file in install_dir/webapps/ROOT/WEB-INF/classes as prescribed in the tutorial.
But the servlet did not run.
After that i placed it in install_dir/shared/classes and it ran .

But surprisingly when I ran other servlet examples they did not run from install_dir/shared/classes but from install_dir/webapps/ROOT/WEB-INF/classes. And i am totally confused . I had followed every step carefully . Please explain this result. Why did i have to change directory after the first servlet execution ?

Thanks and Regards
Akash Singh
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WEB-INF/classes is the correct location for you class files. There's no need to put them anywhere else.

Be sure that your servlet is in a package other then the default, and make sure that the folder hierarchy under WEB-INF/lib reflects that package structure.
 
akaash singh
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Bear

It was just a dummy servlet to check whether everything's configured right . I compiled it in a different directory and just placed the .class file in install_dir/webapps/ROOT/WEB-INF/classes. There were no packages involved .
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"And that" as Yoda says, "is why you fail."
 
Stop it! You're embarassing me! And you are embarrassing 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