java - how to read file from resource folder in eclipse -
i'm trying read xml file resource folder inside webcontent in eclipse project. problem i'm unable read file resources folder working fine giving path outside(ie,e:/new/test.xml).
file file = new file(request.getsession().getservletcontext().getcontextpath()+"/resources/new/test.xml");
can please me solve issue..thanks in advance.
you can read content classpath follows
getclass().getresourceasstream("/new/test.xml");
in eclipse webcontent not in classpath, default thing in classpath /src/test see what's in classpath go project-settings -> java build path, add folders on source tab, folders in classpath.
Comments
Post a Comment