File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Problem in JavaBean

Zaeed McColin
Ranch Hand

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

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

Open source
Steve Luke

Joined: Jan 28, 2003
Posts: 4181

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.

I agree. Here's the link:
subject: Problem in JavaBean
It's not a secret anymore!