• 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

Importing a user-defined class

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

I'm using Oracle's JDevloper for writing programs, and deploying it to Tomcat. I have deployed a web application which is in package "aa.mypacakge". I have also written an encryption program, and this class "enc.class" will be accessed by anybody in our team. Even my program needs to access this class file.

So where should I place it in the Tomcat directory (on the server)? Is it in Tomcat\common\classes ? And how do I have to access it from my program which is calling this class ? Is it

import common.classes.enc;

Any help appreciated
Sara
 
Sheriff
Posts: 67746
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
If the classes are specific to your application, place them in the hierarchy rooted at WEB-INF/classes.

If you want them to be shared across all web apps (be sure that's what you want -- you will be unable to have separate apps use different versions of the classes if you share), place the classes in a jar file and place it in Tomcat's shared/lib folder.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic