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

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

c - getting error: cannot take the address of an rvalue of type 'int' -

How to merge four videos on one screen with ffmpeg -