• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

import statements saga

 
bob reilly
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Shinelin Samuel
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bob reilly wrote:Could they be placed elsewhere within the app?

No. WEB-INF/lib is the location for application-specific libraries.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic