GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes Problem in JavaBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem in JavaBean" Watch "Problem in JavaBean" New topic
Author

Problem in JavaBean

Zaeed McColin
Ranch Hand

Joined: Jan 13, 2009
Posts: 90
hi
I'm developing an webapp
well
root/src/java/classes/XB1.class (XB1 is not a servlet, just a java file)
and
root/xml/xmlns.xml

OK and tomcat 6 for web server
Ok and problem
I want to access to xmlns.xml from XB1.class
Note:the directory of project is dynamic, i mean is on a Flash disk
please help
:confused:


Open source
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

The XML file should be in the application's classpath so you can find it using this.getClass().getResource() to locate it. It is not clear to me what your classpath is since root/src/ doesn't seem to be a normal WebApp classpath (it is usuall like root/WEB-INF/classes/).

See: The Class#getResource() method API.


Steve
 
GeeCON Prague 2014
 
subject: Problem in JavaBean