aspose file tools*
The moose likes Java in General and the fly likes import statements saga Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "import statements saga" Watch "import statements saga" New topic
Author

import statements saga

bob reilly
Ranch Hand

Joined: Jan 22, 2007
Posts: 44
I posted an issue a few days ago and received some very good responses - so thank you all.

My primary complaint was/is I had import statements referencing classes under WEB_INF without any source code.

The solution was to place .jar files containing the ready-compiled classes into my classpath. Subsequently - you can use normal import for the compiled classes. My question - when unzipping the application - would / should the jar files be reflected in the WEB-INF/lib path? Could they be placed elsewhere within the app?

Thank you for your comments...
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

I take it you are referring to deploying the war file.
When the war is exploded, the jar still remains under WEB-INF/lib which is automatically on the class path. The jars placed there will be picked up by default.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Shinelin Samuel
Ranch Hand

Joined: Mar 01, 2010
Posts: 55
'Unzipping the application' - Are you referring to unzipping WAR/EAR file. In that case, yes the jars will be placed inside the /WEB-INF directory of the extracted one.

The J2EE IDEs(eclipse, netbeans etc) however support, to have java libraries (.jars) to be linked with the code base by adding the .jar to the build path. But it is advisable to have it in WEB-INF if the jar is specific for your application, the reason being when you export the Source code to WAR, it will include only the jars inside your WEB-INF directory.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

bob reilly wrote:Could they be placed elsewhere within the app?

No. WEB-INF/lib is the location for application-specific libraries.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: import statements saga
 
Similar Threads
ANT build file
unable to compile class for JSP
Needs to Import Other JAR Files to My Spring Web Services Project
problem in making jar and war based on the 'src' package hierarchy!
My application is false status when i see in Tomcat manager (Struts 2) - URGENT PLEASE