xml - Can't find the file in Java web project -
i stuck here last night. in project, need read xml file , use relative path.(like string location = "auctionitem.xml"; file f = new file(location); below)
string location = "auctionitem.xml"; file f = new file(location); document doc = builder.parse(f);
it worked if used java text file.
public static void main(string[] arg){ file f = new file("auctionitem.xml"); system.out.println(auctionitemscontrol.getvalue().size()); // here method below call function has relative path. }
however, when used them in project jsp, gave error : java.io.filenotfoundexception:/users/xxx/documents/tool/web/eclipse/eclipse.app/contents/macos/auctionitem.xml (no such file or directory)