File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in JavaBean

 
Zaeed McColin
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Steve Luke
Bartender
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic