wood burning stoves 2.0*
The moose likes Java in General and the fly likes Retrieving URL using getResource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Retrieving URL using getResource" Watch "Retrieving URL using getResource" New topic
Author

Retrieving URL using getResource

Santosh Raveendran
Ranch Hand

Joined: Jun 29, 2008
Posts: 83
Hi Team,

In my project i need to retrieve the url to a resource(xml file ) in one java project from another project ,two project are in the same work space.

i tried the same when the resource is in the same project that is working but when the resource is in a different project its not working and the url is coming as null.

please find the piece of code i used for getting the url



SCJP 1.4,SCWCD5, SCBCD5
Thanks, Santhosh
Pratap koritala
Ranch Hand

Joined: Sep 27, 2006
Posts: 252
When the resource in another project, it is not in classpath.
So try adding project dependency( assumed you are using eclipse by the usage of term workspace)

Properties --> Java build path-> projects
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retrieving URL using getResource
 
Similar Threads
Forwarding request to same servlet
OutputStream writing and SSL
Tomcat/MYSQL
i18n taglib
Configuration of filter problem