jQuery in Action, 2nd edition*
The moose likes JSP and the fly likes rules for location of Java .class files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "rules for location of Java .class files" Watch "rules for location of Java .class files" New topic
Author

rules for location of Java .class files

Robin Clark
Ranch Hand

Joined: Dec 17, 2003
Posts: 81
I have two different web applications that have different JSPs. However, they both use a common set of java classes that are in a package called vss.
I am having trouble trying to get the JSP to find the vss package unless it is installed under my web application in WEB-INF/classes.
I would like to install the package in a directory that is entirely separate from the Tomcat installation. I did this and then placed the full path name for the vss.jar in my classpath environment variable. I re-started Tomcat.
The application is a bit complicated because it is VXML instead of HTML, in other words it is a voice application, not a web browser application. In any case, suffice it to say that it didn't work with my new configuration. Can someone tell me if there are rules against executing Java classes that are not in the WEB-INF directory structure? Or did I just do something wrong? It is entirely possible because there are so many weird bits and pieces to this application.
For now, I am maintaining two copies of the source code and the compiled classes -- one under each web application's WEB-INF directory.
Thank you!
brad balmer
Ranch Hand

Joined: Mar 08, 2004
Posts: 57
You could just maintain one location for the source and then instead of deploying the .class files in a directory, jar them up and place them in the WEB-INF/lib directory.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Most servlet containers will take no heed of the system classpath. To share a library of classes across multiple web applications, each container will provide a common area. In Tomcat, for example, you would jar up your classes and place the jar file in $CATALINA_HOME/shared/lib.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Robin Clark
Ranch Hand

Joined: Dec 17, 2003
Posts: 81
Thank you. I think that I will keep the source code under one app and place the vss.jar in my Tomcat common/lib directory.
I forgot that Tomcat ignores the system classpath. As usual I am trying to do too many things at one time so it is hard to see which one of them is causing me problems.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: rules for location of Java .class files
 
Similar Threads
Package not found error in JSP
Can a class outsiad the ../WEB-INF/ call the class under ../WEB-INF/?
Unable to compile class for JSP error
How to create package for web app in Eclipse
Where does this package go?